/* TunnelMosaic Styles - L'Oreal LDB Amplified Hive */

/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: 'Montserrat', sans-serif;
    overflow-x: hidden;
}

body {
    background-image: url('assets/BG.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh;
    /* Dynamic viewport for mobile */
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
}

/* Container */
.container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px 20px;
    position: relative;
}

/* Header with L'Oreal Logo */
.header {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0;
    margin-bottom: 16px;
}

.loreal-logo {
    width: 120px;
    height: auto;
    object-fit: contain;
}

/* Main Logo */
.main-logo {
    width: 100%;
    max-width: 380px;
    height: auto;
    margin-bottom: 40px;
    padding: 0 10px;
}

/* Form Container */
.form-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    flex: 1;
    padding: 0 10px;
}

/* Name Input Field - CSS styled */
.input-wrapper {
    position: relative;
    width: 100%;
    max-width: 340px;
}

.name-input {
    width: 100%;
    height: 60px;
    background: rgba(0, 20, 60, 0.5);
    border: 2px solid rgba(0, 180, 255, 0.5);
    border-radius: 8px;
    outline: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 500;
    color: white;
    text-align: center;
    letter-spacing: 0.5px;
    padding: 0 20px;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 150, 255, 0.15),
        inset 0 0 20px rgba(0, 100, 200, 0.1);
}

.name-input:focus {
    border-color: rgba(0, 220, 255, 0.8);
    box-shadow: 0 0 25px rgba(0, 180, 255, 0.35),
        0 0 50px rgba(0, 150, 255, 0.15),
        inset 0 0 25px rgba(0, 120, 220, 0.15);
}

.name-input:hover:not(:focus) {
    border-color: rgba(0, 200, 255, 0.65);
    box-shadow: 0 0 20px rgba(0, 160, 255, 0.25),
        inset 0 0 20px rgba(0, 100, 200, 0.1);
}

.name-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}

.name-input:focus::placeholder {
    opacity: 0.4;
}

/* Photo Preview */
.photo-preview {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(0, 200, 255, 0.7);
    box-shadow: 0 0 25px rgba(0, 200, 255, 0.4),
        0 0 50px rgba(0, 100, 200, 0.2);
    display: none;
    margin: 8px 0;
}

.photo-preview.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Upload Button */
.upload-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px;
    cursor: pointer;
}

.upload-button {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.upload-wrapper:hover .upload-button {
    transform: scale(1.03);
    filter: brightness(1.1);
}

.upload-wrapper:active .upload-button {
    transform: scale(0.98);
}

.upload-wrapper.has-file .upload-button {
    filter: hue-rotate(80deg) brightness(1.15) saturate(1.2);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-name {
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 10px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 20px;
}

/* Submit Button */
.submit-wrapper {
    position: relative;
    width: 100%;
    max-width: 280px;
    cursor: pointer;
    margin-top: 8px;
}

.submit-button {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.2s ease, filter 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
}

.submit-wrapper:hover .submit-button {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.submit-wrapper:active .submit-button {
    transform: scale(0.97);
}

.submit-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.submit-button:disabled:hover {
    transform: none;
    filter: none;
}

/* Footer with Brand Logos */
.footer {
    width: 100%;
    padding: 24px 10px 10px;
    display: flex;
    justify-content: center;
    margin-top: auto;
}

.brands-logo {
    width: 100%;
    max-width: 400px;
    height: auto;
    opacity: 0.95;
}

/* Thank You Page Styles */
.thank-you-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 50px 24px;
}

.thank-you-title {
    font-size: 42px;
    font-weight: 800;
    color: white;
    text-shadow: 0 0 30px rgba(100, 200, 255, 0.6),
        0 0 60px rgba(50, 150, 255, 0.3);
    margin-bottom: 36px;
    letter-spacing: 3px;
}

.thank-you-message {
    font-size: 26px;
    font-weight: 600;
    color: white;
    text-shadow: 0 0 20px rgba(100, 200, 255, 0.5);
    line-height: 1.5;
    max-width: 320px;
    letter-spacing: 1px;
}

/* Loading/Error States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 15, 50, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 24px;
    font-size: 17px;
    color: white;
    letter-spacing: 1px;
}

.error-message {
    background: rgba(255, 50, 50, 0.15);
    border: 1px solid rgba(255, 100, 100, 0.4);
    border-radius: 12px;
    padding: 16px 24px;
    margin-top: 16px;
    color: #ff9999;
    font-size: 14px;
    text-align: center;
    max-width: 320px;
    display: none;
    line-height: 1.4;
}

.error-message.active {
    display: block;
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-6px);
    }

    40%,
    80% {
        transform: translateX(6px);
    }
}

/* Image Cropper Modal */
.cropper-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 10, 40, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(10px);
    padding: 20px;
}

.cropper-modal.active {
    opacity: 1;
    visibility: visible;
}

.cropper-container {
    background: rgba(10, 30, 70, 0.9);
    border-radius: 16px;
    border: 1px solid rgba(0, 150, 255, 0.3);
    box-shadow: 0 0 40px rgba(0, 100, 200, 0.3),
        0 0 80px rgba(0, 50, 150, 0.2);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cropper-header {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(0, 150, 255, 0.2);
    text-align: center;
}

.cropper-header h2 {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 1px;
}

.cropper-body {
    flex: 1;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    max-height: 50vh;
    background: rgba(0, 0, 0, 0.3);
}

.cropper-body img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.cropper-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid rgba(0, 150, 255, 0.15);
    background: rgba(0, 20, 60, 0.5);
}

.cropper-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid rgba(0, 180, 255, 0.4);
    background: rgba(0, 100, 200, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cropper-btn:hover {
    background: rgba(0, 150, 255, 0.35);
    border-color: rgba(0, 200, 255, 0.6);
    transform: scale(1.05);
}

.cropper-btn:active {
    transform: scale(0.95);
}

.cropper-btn svg {
    width: 22px;
    height: 22px;
}

.cropper-actions {
    display: flex;
    gap: 16px;
    padding: 20px 24px;
    border-top: 1px solid rgba(0, 150, 255, 0.15);
}

.action-btn {
    flex: 1;
    padding: 14px 24px;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.cancel-btn {
    background: rgba(100, 100, 120, 0.3);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(150, 150, 170, 0.3);
}

.cancel-btn:hover {
    background: rgba(120, 120, 140, 0.4);
    color: white;
}

.confirm-btn {
    background: linear-gradient(135deg, #6366f1 0%, #0ea5e9 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
}

.confirm-btn:active {
    transform: translateY(0);
}

/* Cropper.js overrides for dark theme */
.cropper-view-box {
    outline: 2px solid rgba(0, 200, 255, 0.8);
    outline-offset: -2px;
}

.cropper-line {
    background-color: rgba(0, 200, 255, 0.5);
}

.cropper-point {
    background-color: rgba(0, 200, 255, 0.9);
    width: 10px;
    height: 10px;
}

.cropper-modal-bg {
    background-color: rgba(0, 0, 0, 0.6);
}

/* Responsive Adjustments */
@media (max-height: 750px) {
    .container {
        padding-top: 16px;
    }

    .main-logo {
        max-width: 320px;
        margin-bottom: 28px;
    }

    .form-container {
        gap: 18px;
    }


    .photo-preview {
        width: 90px;
        height: 90px;
    }

    .thank-you-title {
        font-size: 34px;
        margin-bottom: 28px;
    }

    .thank-you-message {
        font-size: 22px;
    }

    .footer {
        padding-top: 16px;
    }
}

@media (max-height: 650px) {
    .header {
        margin-bottom: 10px;
    }

    .loreal-logo {
        width: 100px;
    }

    .main-logo {
        max-width: 260px;
        margin-bottom: 20px;
    }

    .form-container {
        gap: 14px;
    }

    .name-input {
        height: 55px;
        font-size: 17px;
    }

    .photo-preview {
        width: 80px;
        height: 80px;
        margin: 4px 0;
    }

    .upload-wrapper {
        max-width: 260px;
    }

    .submit-wrapper {
        max-width: 240px;
        margin-top: 4px;
    }
}

@media (max-width: 380px) {
    .container {
        padding: 16px 14px 14px;
    }

    .loreal-logo {
        width: 100px;
    }

    .main-logo {
        max-width: 280px;
    }

    .input-wrapper {
        max-width: 300px;
    }

    .upload-wrapper {
        max-width: 260px;
    }

    .submit-wrapper {
        max-width: 240px;
    }

    .thank-you-title {
        font-size: 32px;
    }

    .thank-you-message {
        font-size: 20px;
    }
}

/* Large screens */
@media (min-height: 900px) {
    .main-logo {
        margin-bottom: 50px;
    }

    .form-container {
        gap: 28px;
    }

    .photo-preview {
        width: 120px;
        height: 120px;
    }

    .thank-you-content {
        padding: 60px 24px;
    }
}