/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 
================================================================================
RESPONSIVE BREAKPOINT SETTING - TWEAK THIS TO CONTROL WHEN VERTICAL LAYOUT STARTS
================================================================================

TO ADJUST THE BREAKPOINT:
1. Change the value in --responsive-breakpoint below
2. Change the same value in BOTH media queries marked with "RESPONSIVE BREAKPOINT"
3. Values to try:
   - 1300px = Earlier vertical layout (more space prevention)
   - 1200px = Current setting (default)
   - 1100px = Later vertical layout (more horizontal space)
   - 1000px = Even later vertical layout

EXAMPLE: If elements overlap at 1350px width, set both values to 1400px
*/
:root {
    --responsive-breakpoint: 1100px;  /* Main breakpoint - also update media queries below */
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Inter', sans-serif;
    background: radial-gradient(ellipse 105% 100% at bottom center, #6b3d9a 0%, #4a2674 32%, #3a1c5c 65%, #2d124d 90%, #1a0a2e 100%);
    color: #ffffff;
    overflow-x: hidden;
    height: 100vh;
    position: relative;
}

/* RESPONSIVE BREAKPOINT: Change 1100px below to match --responsive-breakpoint value above */
@media (max-width: 1100px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Three.js Canvas Container */
.crane-container {
    flex: 1;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    position: relative;
    z-index: 2;
    min-width: 0; /* Ensure flex item can shrink */
    transition: all 0.3s ease;
}

.crane-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle 200px at var(--mouse-x, 50%) var(--mouse-y, 50%), 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 30%, 
        transparent 70%);
    border-radius: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.crane-container:hover::before {
    opacity: 1;
}

#three-canvas {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    background: transparent;
    display: block;
}

/* Grid Overlay */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.07) 2px, transparent 2px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.07) 2px, transparent 2px);
    background-size: 160px 160px;
    pointer-events: none;
}

.grid-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.9) 2px, transparent 2px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.9) 2px, transparent 2px);
    background-size: 160px 160px;
    mask: radial-gradient(circle 350px at var(--mouse-x, 50%) var(--mouse-y, 50%), black 0%, black 15%, rgba(0,0,0,0.8) 30%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.2) 70%, transparent 100%);
    -webkit-mask: radial-gradient(circle 350px at var(--mouse-x, 50%) var(--mouse-y, 50%), black 0%, black 15%, rgba(0,0,0,0.8) 30%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.2) 70%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease-out;
    pointer-events: none;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.grid-overlay.grid-shine-active::before {
    opacity: 1;
}

/* Language change gradient line effect - separate unmasked grid layer */
.grid-line-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Behind UI elements but above background */
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.95) 2px, transparent 2px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.95) 2px, transparent 2px);
    background-size: 160px 160px;
    mask: linear-gradient(
        90deg,
        transparent 0%,
        transparent calc(var(--line-position, -30%) - 15%),
        rgba(0, 0, 0, 0.3) calc(var(--line-position, -30%) - 10%),
        rgba(0, 0, 0, 0.7) calc(var(--line-position, -30%) - 5%),
        black var(--line-position, -30%),
        rgba(0, 0, 0, 0.7) calc(var(--line-position, -30%) + 5%),
        rgba(0, 0, 0, 0.3) calc(var(--line-position, -30%) + 10%),
        transparent calc(var(--line-position, -30%) + 15%),
        transparent 100%
    );
    -webkit-mask: linear-gradient(
        90deg,
        transparent 0%,
        transparent calc(var(--line-position, -30%) - 15%),
        rgba(0, 0, 0, 0.3) calc(var(--line-position, -30%) - 10%),
        rgba(0, 0, 0, 0.7) calc(var(--line-position, -30%) - 5%),
        black var(--line-position, -30%),
        rgba(0, 0, 0, 0.7) calc(var(--line-position, -30%) + 5%),
        rgba(0, 0, 0, 0.3) calc(var(--line-position, -30%) + 10%),
        transparent calc(var(--line-position, -30%) + 15%),
        transparent 100%
    );
    opacity: 0;
    transition: none;
    pointer-events: none;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.5));
}

.grid-line-layer.active {
    opacity: 1;
}

/* Remove UI Overlay - no longer needed */

/* Language Toggle */
.language-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 5;
    pointer-events: auto;
}

.language-switch {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    width: 110px;
    height: 45px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.language-switch:hover {
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.language-option {
    flex: 1;
    padding: 0.5rem 0;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 20px;
    z-index: 2;
    position: relative;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.language-option.active {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
}

.language-slider {
    position: absolute;
    top: 0.3rem;
    left: 0.3rem;
    width: calc(50% - 0.4rem);
    height: calc(100% - 0.6rem);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-radius: 18px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.language-switch[data-active="en"] .language-slider {
    transform: translateX(calc(50% + 1.7rem));
}

.language-option:hover {
    color: rgba(255, 255, 255, 0.85);
    transform: scale(1.05);
}

.content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6rem 3% 2rem 3%;
    max-width: 1600px;
    margin: 0 auto;
    gap: 0;
    min-height: 100vh;
}

/* Main Content */
.main-content {
    flex: 0 0 500px;
    max-width: 500px;
    pointer-events: auto;
    z-index: 4;
    position: relative;
    margin-top: 2rem;
}

.title {
    font-size: 3.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.05em;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.2), 0 0 15px rgba(255, 255, 255, 0.3);
    font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.subtitle {
    font-size: 1.2rem;
    line-height: 1.6;
    opacity: 0.9;
    font-weight: 500;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.15), 0 0 10px rgba(255, 255, 255, 0.2);
}

.subtitle p {
    margin-bottom: 1rem;
}

/* Contact Section */
.contact-section {
    flex: 0 0 450px;
    width: 450px;
    pointer-events: auto;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    z-index: 4;
    position: relative;
}

.contact-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3), 0 0 10px rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.95);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-wrapper {
    position: relative;
}

.input-wrapper.required {
    position: relative;
}

.required-indicator {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    color: #f39c12;
    font-size: 1.2rem;
    font-weight: bold;
    pointer-events: none;
    opacity: 0.85;
    text-shadow: 0 0 12px rgba(243, 156, 18, 0.5);
    transition: all 0.3s ease;
}

.input-wrapper.required input:focus + .required-indicator {
    opacity: 1;
    color: #e67e22;
    transform: scale(1.1);
}

.contact-form input,
.contact-form textarea {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    padding: 1.2rem 1.5rem;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(15px);
    font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.input-wrapper.required input {
    border-left: 3px solid rgba(243, 156, 18, 0.4);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.08) 100%);
}

.input-wrapper.required input:focus {
    border-left-color: rgba(243, 156, 18, 0.7);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.10) 100%);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.15), 0 12px 40px rgba(0, 0, 0, 0.15);
}

.input-wrapper:focus-within {
    animation: float 2s ease-in-out infinite;
}

.contact-form input.valid {
    border-color: #2ecc71;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15) 0%, rgba(46, 204, 113, 0.08) 100%);
    box-shadow: 0 0 25px rgba(46, 204, 113, 0.4), 0 8px 32px rgba(46, 204, 113, 0.2);
}

.contact-form input.invalid {
    border-color: #e74c3c;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.15) 0%, rgba(231, 76, 60, 0.08) 100%);
    box-shadow: 0 0 25px rgba(231, 76, 60, 0.4), 0 8px 32px rgba(231, 76, 60, 0.2);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}



.send-btn {
    background: linear-gradient(135deg, #f1948a 0%, #bb8fce 100%);
    border: none;
    border-radius: 25px;
    padding: 0.8rem 2rem;
    color: #000000;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(241, 148, 138, 0.4);
    text-transform: none;
    letter-spacing: 0.5px;
    font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.3), 0 0 4px rgba(0, 0, 0, 0.2);
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(241, 148, 138, 0.6);
}

.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.status-message {
    margin-top: 0;
    padding: 0;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transform: translateY(-10px);
}

.status-message.show {
    opacity: 1;
    transform: translateY(0);
    margin-top: 1rem;
    padding: 0.75rem;
    height: auto;
}

.status-message.success {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15) 0%, rgba(46, 204, 113, 0.08) 100%);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.status-message.error {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.15) 0%, rgba(231, 76, 60, 0.08) 100%);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Success Popup Modal */
.success-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.success-popup.show {
    opacity: 1;
    visibility: visible;
}

.success-popup-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.8) translateY(50px);
    transition: all 0.3s ease;
}

.success-popup.show .success-popup-content {
    transform: scale(1) translateY(0);
}

.success-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: normal;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    line-height: 1;
    text-align: center;
    font-family: Arial, sans-serif;
}

.success-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.success-popup-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    color: white;
    animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(46, 204, 113, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(46, 204, 113, 0.6);
    }
}

.success-popup-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.success-popup-message {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.success-popup-button {
    background: linear-gradient(135deg, #f1948a 0%, #bb8fce 100%);
    border: none;
    border-radius: 25px;
    padding: 0.8rem 2rem;
    color: #000000;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(241, 148, 138, 0.4);
    font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.success-popup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(241, 148, 138, 0.6);
}

/* Letter Animation Enhancements */
[data-bg][data-en] {
    overflow: visible;
    white-space: normal;
}

[data-bg][data-en] span {
    display: inline-block;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    perspective: 1000px;
    white-space: pre;
}

/* Smooth text rendering during animations */
[data-bg][data-en] span {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Intermediate scaling for desktop layout at smaller sizes */
@media (max-width: 1550px) and (min-width: 1101px) {
    .content-wrapper {
        padding: 6rem 2% 2rem 2%;
        gap: 1rem;
    }
    
    .main-content {
        flex: 0 0 450px;
        max-width: 450px;
    }
    
    .contact-section {
        flex: 0 0 400px;
        width: 400px;
        padding: 2rem;
    }
    
    .title {
        font-size: 2.8rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .contact-section h2 {
        font-size: 1.8rem;
    }
    
    .crane-container {
        height: 350px;
    }
}

/* Further scaling for tighter desktop layout */
@media (max-width: 1350px) and (min-width: 1101px) {
    .main-content {
        flex: 0 0 400px;
        max-width: 400px;
    }
    
    .contact-section {
        flex: 0 0 350px;
        width: 350px;
        padding: 1.8rem;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .contact-section h2 {
        font-size: 1.6rem;
    }
    
    .crane-container {
        height: 320px;
    }
}

/* Responsive Design */
/* RESPONSIVE BREAKPOINT: Change 1100px below to match --responsive-breakpoint value above */
@media (max-width: 1100px) {
    .content-wrapper {
        flex-direction: column;
        justify-content: flex-start;
        padding: 6rem 1.5rem 1.5rem 1.5rem;
        gap: 1.5rem;
        height: auto;
    }
    
    .crane-container {
        flex: none;
        width: 100%;
        height: 300px;
        margin: 2rem 0;
        min-width: 100%;
        max-width: 100%;
    }
    
    .language-toggle {
        top: 1.5rem;
        right: 1.5rem;
    }
    
    .title {
        font-size: 2.8rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .main-content {
        flex: none;
        max-width: 100%;
        padding-top: 1.5rem;
        text-align: center;
        margin-top: 3rem;
    }
    
    .contact-section {
        flex: none;
        width: 100%;
        max-width: 500px;
    }
}

/* MOBILE BREAKPOINT: Adjust this value if needed for mobile-specific styling */
@media (max-width: 768px) {
    .language-toggle {
        top: 1rem;
        right: 1rem;
    }
    
    .content-wrapper {
        padding: 6rem 1rem 1rem 1rem;
        gap: 1rem;
    }
    
    .title {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .crane-container {
        height: 250px;
        margin: 1.5rem 0;
    }
    
    .contact-section {
        width: 100%;
        max-width: 100%;
        padding: 2rem 1.5rem;
    }
    
    .main-content {
        padding-top: 1rem;
        margin-top: 3rem;
    }
    
    .success-popup-content {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
    
    .success-popup-title {
        font-size: 1.5rem;
    }
    
    .success-popup-message {
        font-size: 1rem;
    }
    
    .success-popup-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .required-indicator {
        top: 1rem;
        right: 1rem;
        font-size: 1.1rem;
    }
    
    .contact-form input,
    .contact-form textarea {
        padding: 1rem 1.2rem;
        border-radius: 14px;
    }
} 