/* ============================================================
   FUTURE 4K - MAIN STYLESHEET
   Exact colors and design from ui.py Streamlit app
   ============================================================ */

/* Import fonts */
/* DELETE OR COMMENT THIS LINE */
/* @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Sora:wght@600;700;800&display=swap'); */
/* ============================================================
   FONTS - System fonts (no external dependency)
   ============================================================ */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg);
    color: var(--ink);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--ink);
    font-weight: 700;
}

/* ============================================================
   CSS VARIABLES - Exact from ui.py
   ============================================================ */
:root {
    --bg: #F4F5F7;
    --surface: #FFFFFF;
    --ink: #14181F;
    --ink-muted: #626B76;
    --accent: #0FA968;
    --accent-dark: #0B7F4F;
    --accent-light: #E8F5E9;
    --accent-hover: #1DBF7A;
    --navy: #101A30;
    --line: #E4E7EB;
    --card-border: #0FA968;
    --card-bg: #FFFFFF;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--ink);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Sora', sans-serif;
    color: var(--ink);
    font-weight: 800;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--accent-dark);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR - Exact navy design from ui.py
   ============================================================ */
.sidebar {
    background-color: var(--navy);
    width: 280px;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 1.5rem 1rem;
    color: #C4CCDA;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar * {
    color: #C4CCDA;
}

.sidebar h1,
.sidebar h2,
.sidebar h3 {
    color: #FFFFFF;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: fixed;
    left: 290px;
    top: 1rem;
    z-index: 101;
    background-color: var(--accent);
    color: #FFFFFF;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.sidebar-toggle:hover {
    background-color: var(--accent-dark);
    transform: scale(1.1);
}

.sidebar-toggle.sidebar-hidden {
    left: 10px;
}

.logo-section {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-section img {
    height: 56px;
    width: auto;
    margin-bottom: 0.5rem;
}

.logo-title {
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: 1.9rem;
    line-height: 1.1;
    color: #FFFFFF;
    margin: 0.5rem 0 0.2rem 0;
}

.logo-tagline {
    font-size: 0.85rem;
    color: #C4CCDA;
    letter-spacing: 0.03em;
}

.user-info {
    background: rgba(15, 169, 104, 0.15);
    border: 1px solid rgba(15, 169, 104, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.user-info p {
    margin: 0.3rem 0;
    font-size: 0.9rem;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: 0;
    flex: 1;
    padding: 2rem;
    width: 100%;
}
/* ============================================================
   NAVIGATION TABS - Exact from ui.py
   ============================================================ */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--line);
    padding-bottom: 0;
}

.nav-tab {
    background: transparent;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.nav-tab:hover {
    color: var(--accent-dark);
}

.nav-tab.active {
    color: var(--accent-dark);
    border-bottom-color: var(--accent);
}

/* ============================================================
   CARDS - Exact hover effect from ui.py
   ============================================================ */
.card {
    border-radius: 12px;
    border: 2px solid var(--card-border);
    background-color: var(--card-bg);
    padding: 1.5rem;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
    margin-bottom: 1rem;
}

.card:hover {
    box-shadow: 0 6px 20px rgba(15, 169, 104, 0.15);
    border-color: var(--accent-dark);
}

.tool-card {
    cursor: pointer;
}

.tool-card h3 {
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

.tool-card p {
    color: var(--ink-muted);
    font-size: 0.9rem;
    margin: 0.5rem 0 1rem 0;
}

/* Icon chip - Exact from ui.py */
.icon-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: rgba(15, 169, 104, 0.12);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--accent-dark);
}

/* ============================================================
   GRID LAYOUTS
   ============================================================ */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    transition: border-color 0.15s ease;
}

.metric-card:hover {
    border-color: var(--accent);
}

.metric-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.metric-label {
    display: block;
    font-size: 0.9rem;
    color: var(--ink-muted);
}

/* ============================================================
   BUTTONS - Exact design from ui.py
   ============================================================ */
button, .btn {
    background-color: var(--accent);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

button:hover, .btn:hover {
    background-color: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 169, 104, 0.3);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background-color: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}

.btn-secondary:hover {
    background-color: var(--accent-light);
    border-color: var(--accent-dark);
    color: var(--accent-dark);
}

.btn-full {
    width: 100%;
}

/* ============================================================
   FORMS & INPUTS - Exact focus effect from ui.py
   ============================================================ */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--ink);
    font-weight: 500;
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background-color: #FFFFFF;
    color: var(--ink);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(15, 169, 104, 0.2);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

select {
    cursor: pointer;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--line);
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 24, 31, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    border: 4px solid rgba(15, 169, 104, 0.2);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #FFFFFF;
    margin-top: 1rem;
    font-size: 1.1rem;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: #FFFFFF;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background-color: var(--accent);
}

.toast-error {
    background-color: #ff4444;
}

.toast-warning {
    background-color: #ff9800;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 24, 31, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Star rating buttons */
.star-btn {
    transition: transform 0.1s ease;
}

.star-btn:hover {
    transform: scale(1.2);
}

.star-rating {
    background: none !important;
    border: none !important;
    font-size: 2rem !important;
    cursor: pointer;
    padding: 0.2rem !important;
    opacity: 0.3;
    transition: opacity 0.2s, transform 0.2s;
}

.star-rating:hover,
.star-rating.active {
    opacity: 1;
    transform: scale(1.1);
}

/* Admin sub-tabs */
.admin-tab-content {
    margin-top: 1.5rem;
}

.admin-tab-content.hidden {
    display: none;
}

/* Pricing sub-tabs */
.pricing-subtab {
    margin-top: 1.5rem;
}

.pricing-subtab.hidden {
    display: none;
}

/* Security log items */
.security-log-item {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--line);
    background: var(--surface);
}

.security-log-item.fail {
    border-left-color: #ff4444;
    background: #fff5f5;
}

.security-log-item.success {
    border-left-color: var(--accent);
    background: var(--accent-light);
}

/* Template code blocks */
.template-code {
    background: #f8f9fa;
    padding: 0.8rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--ink);
    margin: 0.8rem 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--ink-muted);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        min-height: auto;
        transform: translateX(0);
    }
    
    .sidebar.hidden {
        display: none;
    }
    
    .sidebar-toggle {
        left: 10px;
        top: 10px;
    }
    
    .sidebar-toggle.sidebar-hidden {
        left: 10px;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }
    
    .main-content.sidebar-hidden {
        margin-left: 0;
        width: 100%;
    }
    
    .tool-grid {
        grid-template-columns: 1fr;
    }
    
    .metrics {
        grid-template-columns: 1fr;
    }
    
    .nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }

    .nav-tab {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* Admin pricing rows, resolution/quality multiplier rows,
       frame rules — inline grid-template-columns override karna
       zaroori hai kyunki inline styles CSS se zyada priority
       rakhte hain — is liye !important use kiya hai */
    [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Forms mein number/select pairs jo grid mein side-by-side
       thay, ab stack ho jayenge upar wale rule se — labels ko
       thoda spacing do taake crowd na lagen */
    .form-group {
        margin-bottom: 1.2rem;
    }

    /* Touch targets kam se kam 44px height ke hon (Apple/Google
       guideline) — chhote admin action buttons (🗑️, 🔄, etc.) */
    button, .btn, .btn-secondary {
        min-height: 44px;
        padding: 0.7rem 1.2rem;
    }

    /* Tables (Admin > All Jobs) ko horizontally scrollable
       rakho, font chhota karo taake zyada columns fit hon */
    table {
        font-size: 0.8rem;
    }

    table th, table td {
        padding: 6px 8px !important;
        white-space: nowrap;
    }

    /* Video player full width, aspect ratio maintain */
    video {
        width: 100% !important;
        height: auto !important;
    }

    /* Modal (confirm dialog) mobile pe thoda margin */
    #confirmModalOverlay > div {
        width: 92% !important;
        padding: 1.25rem !important;
    }

    /* Textarea mobile pe zyada tight na ho */
    textarea {
        min-height: 90px;
    }

    h2 {
        font-size: 1.4rem;
    }

    h3 {
        font-size: 1.15rem;
    }
}

/* Extra small phones (iPhone SE jaisa, ~375px aur neeche) */
@media (max-width: 400px) {
    .main-content {
        padding: 0.75rem;
    }

    .card {
        padding: 1rem;
    }

    .metric-value {
        font-size: 1.5rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sidebar-toggle {
        display: flex;
    }
}


/* ============================================================
   PAY-PER-VIDEO SUB-TABS
   ============================================================ */
.subtab-content {
    margin-top: 1.5rem;
}

.subtab-content.hidden {
    display: none;
}

/* Star rating style */
.star-rating {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.2s, transform 0.1s;
    padding: 0;
    margin: 0;
}

.star-rating:hover,
.star-rating.active {
    opacity: 1;
    transform: scale(1.1);
}

/* Price estimate styles */
#priceEstimate {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

#priceEstimate.hidden {
    display: none;
}

/* Manual payment instructions */
#manualPaymentInstructions {
    margin: 1rem 0;
}

/* Payment request cards */
#manualPaymentRequests .card {
    transition: all 0.2s;
}

#manualPaymentRequests .card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}


/* ============================================================
   FEEDBACK SUB-TABS
   ============================================================ */
.feedback-subtab {
    margin-top: 1.5rem;
}

.feedback-subtab.hidden {
    display: none;
}

/* Feedback card styling */
.feedback-subtab .card {
    transition: all 0.2s ease;
}

.feedback-subtab .card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(15, 169, 104, 0.15);
}
