/* START OF FILE static/css/styles.css */

/* --- Global Styles & Variables --- */
:root {
    --dark-bg: #111827;
    --dark-bg-secondary: #1f2937;
    --primary-accent: #a855f7;
    --secondary-accent: #ec4899;
    --light-text: #f3f4f6;
    --medium-text: #9ca3af;
    --card-bg: #ffffff;
    --card-border: #374151;
}

body {
    font-family: 'Heebo', sans-serif; /* Using the new font */
    line-height: 1.6;
    padding: 0;
    direction: rtl;
    text-align: right;
    background-color: var(--dark-bg); /* New dark background */
    color: var(--light-text); /* New light text for dark bg */
    margin: 0;
}

#app-initial-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--dark-bg);
    z-index: 2000;
    font-size: 1.2em;
    color: var(--light-text);
}


h2 {
    color: var(--light-text);
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 700;
}

label {
    display: inline-block;
    margin-bottom: 5px;
    min-width: 80px;
    font-weight: 600;
    color: #4b5563; /* Darker text for light cards */
}

input[type="email"],
input[type="password"],
input[type="file"] {
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid #d1d5db; /* Lighter border for inputs */
    border-radius: 6px;
    width: 280px;
    box-sizing: border-box;
    background-color: #f9fafb;
}

button {
    background: linear-gradient(90deg, var(--primary-accent), var(--secondary-accent));
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 50px; /* Rounded buttons */
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 700;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: inline-flex; /* Ensures icon and text align nicely */
    align-items: center;
    justify-content: center;
}
button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
button:disabled {
    background: #4b5563; /* Dark gray for disabled */
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- Authentication Section (remains light) --- */
#auth-section {
     margin: 40px auto;
     max-width: 400px;
}
#login-section, #register-section, #verification-prompt {
    padding: 25px 30px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background-color: var(--card-bg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    color: #111827; /* Dark text for auth forms */
}
#login-section h2, #register-section h2, #verification-prompt h2 {
    color: #111827;
    text-align: center;
    margin-bottom: 20px;
    border-bottom: none;
    font-weight: 900;
}
.google-signin-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 15px; border: 1px solid #ccc; border-radius: 50px; background-color: #fff; color: #444; font-size: 14px; cursor: pointer; transition: background-color 0.3s; margin-top: 15px; width: 100%;
}
.google-signin-button:hover { background-color: #f5f5f5; }
.separator { text-align: center; margin: 20px 0; color: #6b7280; }


/* --- Logged-in User Section --- */
#sticky-header-wrapper {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 999;
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 25px;
    background-color: var(--dark-bg-secondary);
    border-bottom: 1px solid var(--card-border);
}

.user-header h1 {
    font-size: 1.8em;
    font-weight: 900;
    margin: 0;
    flex-grow: 1;
    text-align: center;
    color: white;
    border-bottom: none;
}

.user-header .user-details-group {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9em;
}

.user-header .user-details-group p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
}

#user-email {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 15ch;
}

#user-credits-display-container {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

.credits-label { display: none; }
#user-credits-value {
    color: var(--primary-accent);
    font-weight: 700;
    background: none;
    border: none;
    padding: 0;
}
#user-credits-value::before {
    content: '\f005'; /* FontAwesome star icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 5px;
    color: #facc15;
}

#logout-button {
    background: var(--dark-bg);
    color: var(--medium-text);
    padding: 8px 16px;
    border: 1px solid var(--card-border);
    gap: 8px;
    border-radius: 50px;
}
#logout-button:hover {
    background-color: var(--card-border);
    color: white;
}

/* --- Tab Navigation Styles --- */
.tab-navigation {
    display: flex;
    justify-content: center;
    background-color: var(--dark-bg);
    padding: 0 20px;
    border-bottom: 1px solid var(--card-border);
    margin-top: -8px;
}

.tab-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

.tab-navigation a {
    display: block;
    padding: 0.5rem 1.5rem;
    text-decoration: none;
    color: var(--medium-text);
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.2s ease, border-color 0.2s ease;
    border: none;
    border-bottom: 3px solid transparent;
}

.tab-navigation a:hover { color: white; }
.tab-navigation a.active {
    color: white;
    font-weight: 700;
    border-bottom: 3px solid var(--primary-accent);
}

/* --- Tab Content Base Styles --- */
#tab-content-wrapper { padding: 0; }
.tab-content { display: none; }
.tab-content.active { display: block; }


/* --- General Message Styles --- */
.status-message {
    font-weight: 500;
    margin: 15px auto;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    text-align: center;
    font-size: 0.95em;
    max-width: 600px;
}
.error, .status-message.error { color: #f87171; background-color: #450a0a; border-color: #7f1d1d; }
.success, .status-message.success { color: #4ade80; background-color: #14532d; border-color: #166534; }
.info, .status-message.info { color: #60a5fa; background-color: #1e3a8a; border-color: #1e40af; }
.warning, .status-message.warning { color: #facc15; background-color: #78350f; border-color: #92400e; }

#global-error-message { margin: 15px auto; }
#upload-status, #login-error, #register-error, #resend-status, #reset-status { margin-top: 15px; }


/* --- MODAL STYLES --- */
.modal {
    background-color: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(5px);
}
.modal-dialog {
    background-color: var(--dark-bg-secondary);
    color: var(--light-text);
    border-radius: 12px;
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.modal-dialog h3 { color: white; border-bottom: 1px solid var(--card-border); }
.modal-close { color: var(--medium-text); }
.modal-close:hover { color: white; }

/* START OF MODIFIED CODE */
/* Generic styling for the image zoom modal */
#imageModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050; /* Ensure it's on top of other content */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

#imageModal .modal-content {
    max-width: 90%;
    max-height: 90%;
    border: 3px solid var(--medium-text);
    border-radius: 4px;
    object-fit: contain; /* Ensure image fits without distortion */
}
/* END OF MODIFIED CODE */

#imageModal .modal-dialog {
    background-color: transparent;
    box-shadow: none;
    border: none;
}
#imageModal .modal-content { border: 3px solid var(--medium-text); }

#shareTryonModal .modal-dialog { background-color: var(--card-bg); color: #111827; }
#shareTryonModal h3 { color: #111827; border-bottom: 1px solid #e5e7eb; }
#shareTryonForm label { color: #4b5563; }
#shareGarmentPreviewName { color: #111827; }
#generatedLinkArea .link-copy-container input[type="text"] {
    background-color: var(--dark-bg);
    color: white;
    border-color: var(--card-border);
}
#copyShareLinkButton {
    background-color: #4b5563;
}
/* ... etc for other modals ... */


/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 767px) {
    /* START OF FINAL MODIFICATION: Flexbox approach for 3 boxes */
    .user-header {
        padding: 10px 15px;
        display: flex;
        align-items: flex-start; /* Align boxes to the top */
        gap: 10px;
    }

    /* Give each direct child a base width */
    .user-header > * {
        flex-basis: 33.33%;
    }

    /* User details in the right-most box */
    .user-header .user-details-group {
        order: 3;
        display: flex;
        flex-direction: column;
        align-items: flex-end; /* Align content to the right */
        gap: 2px;
    }

    .user-header .user-details-group p {
        display: block;
        text-align: right;
        line-height: 1.2;
        margin: 0;
    }

    /* Logo in the center box */
    .user-header h1 {
        order: 2;
        text-align: center;
        padding-top: 5px;
    }

    /* Logout button in the left-most box */
    #logout-button {
        order: 1;
        width: 40px;
        height: 40px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: flex-start; /* Align icon to the left */
        gap: 0;
        flex-shrink: 0;
        background: transparent;
        border: none;
        box-shadow: none;
        border-radius: 50%;
        color: var(--light-text);
        opacity: 0.8;
    }

    #logout-button:hover {
        background-color: rgba(255, 255, 255, 0.1);
        opacity: 1;
    }

    #logout-button > .fa-solid + span {
        display: none;
    }
    /* END OF FINAL MODIFICATION */

    .tab-navigation a { padding: 0.6rem 1rem; font-size: 0.9rem;}
}