/* static/css/components.css */

.project-tile {
    background:
        linear-gradient(
            rgba(var(--accent-blue-rgb), 0.0),  /* 0% opacity at the top */
            rgba(var(--accent-blue-rgb), 0.1)   /* 10% opacity at the bottom */
        ),
        white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    min-height: 200px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.2em;
    font-weight: 600;
    font-family: var(--font-heading);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
}

.project-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    background:
        linear-gradient(
            rgba(var(--brand-gold-rgb), 0.0),
            rgba(var(--brand-gold-rgb), 0.15)
        ),
        white;
}
.empty-state { text-align: center; padding: 50px; color: #777; }

/* --- Dropdown Styles --- */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-menu {
    display: none; /* Hidden by default */
    position: absolute;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 999;
    min-width: 160px;
    right: 0;
}
.dropdown-menu.show {
    display: block; /* The 'show' class makes it visible */
}
.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    white-space: nowrap;
}
.dropdown-item:hover {
    background-color: #f0f0f0;
}



/* ==========================================================================
   RESULTS DASHBOARD COMPONENT STYLES
   ========================================================================== */

.dashboard-component {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.component-title {
    margin: 0 0 1rem 0;
    font-family: var(--font-heading);
    font-size: 1.25rem; /* Reduced from 1.5rem */
    font-weight: 600;
    color: #6c757d;
}

.metric-card-content {
    margin-top: auto;
    margin-bottom: auto;
}

.metric-card-content .metric-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--brand-dark);
    line-height: 1.2;
}

.metric-card-content .metric-value.profit {
    color: var(--brand-green);
}

.metric-card-content .metric-label {
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.25rem;
}



.btn-download::before {
    content: '⬇';
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 1.1em;
}

/* ==========================================================================
   BUTTON COMPONENT
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9em; /* Reduced from 1em */
    color: white;
    padding: 0.6em 1.2em; /* Reduced padding */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.btn-primary { background-color: var(--primary-color); }
.btn-primary:hover { background-color: var(--primary-color-hover); }
.btn-success { background-color: var(--brand-green); }
.btn-success:hover { background-color: var(--brand-green-hover); }
.btn-secondary { background-color: var(--card-background); color: var(--text-color); border: 1px solid var(--border-color); }
.btn-secondary:hover { background-color: var(--primary-color-hover); color: var(--card-background); }
.btn-block { width: 100%; }
.btn-icon::before { content: '▶'; display: inline-block; font-size: 0.8em; margin-top: -1px; }

.run-btn { margin-top: auto; }

.btn:disabled,
.btn[disabled],
.btn.disabled-tile {
    background-color: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.65;
    pointer-events: none;

    /* Override potential hiding rules */
    display: inline-flex;
    visibility: visible;
}

/* Hide icons on disabled buttons */
.btn:disabled::before,
.btn[disabled]::before,
.btn.disabled-tile::before {
    display: none;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

/* Danger button disabled state (faded red/grey) */
.btn-danger:disabled,
.btn-danger[disabled],
.btn-danger.disabled-tile {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c82333;
    border-color: #bd2130;
}

.button-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-profile-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%; /* Makes it a circle */
    background-color: var(--brand-gold);
    color: white;
    font-family: var(--font-heading);
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
}
.user-profile-icon:hover {
    transform: scale(1.1);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #888;
}

/* --- Usage Bar --- */
.usage-bar {
    width: 100%;
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 0.5rem;
}
.usage-bar-fill {
    height: 100%;
    background-color: var(--brand-gold);
    border-radius: 5px;
    transition: width 0.5s ease-in-out;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-weight: 600;
    cursor: pointer;
    font-size: 1em;
    padding: 0;
}
.logout-btn:hover {
    text-decoration: underline;
}


/* --- File Uploader Validation Styles --- */
.file-uploader.success {
    border-color: #28a745; /* Green */
    background-color: #f0fff4;
}

.file-uploader.error {
    border-color: #d9534f; /* Red */
    background-color: #fff0f0;
}

.file-uploader-status {
    margin-top: 0.8rem;
    font-size: 0.9em;
    font-weight: 500;
}

.file-uploader-status.success-message {
    color: #28a745;
}

.file-uploader-status.error-message {
    color: #d9534f;
}

.columns-error-message {
    color: var(--brand-red); /* Uses your existing red variable */
    text-align: left;      /* Aligns the "Required columns:" text to the left */
    padding: 0 1.5rem;     /* Adds some horizontal padding */
    margin-top: 1rem;      /* Adds space between the file input and the error */
    font-size: 0.9em;
}

/* --- Usage Summary Styles --- */
.usage-summary {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
    border: 1px solid var(--border-color);
}
.usage-summary h4 {
    margin-top: 0;
    font-family: var(--font-heading);
}
.usage-limit-warning {
    color: #d9534f;
    font-weight: 600;
    margin-top: 1rem;
}

/* --- Disabled Tile Style (for project tiles) --- */
.project-tile.disabled-tile {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f9fafb;
}
.project-tile.disabled-tile:hover {
    transform: none; /* Disables the hover lift effect */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}




.container-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.25rem;
    margin-top: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}



/* --- User Management Styles --- */
.status-active, .status-inactive {
    padding: 0.25em 0.6em;
    font-size: 0.8em;
    font-weight: 600;
    border-radius: 1em;
    color: #fff;
}
.status-active { background-color: var(--brand-green); }
.status-inactive { background-color: #6c757d; }

/* --- Message/Alert Styles --- */
.alert {
    padding: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
    margin-bottom: 1rem;
    position: relative;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Dismissible alert with close button */
.alert.dismissible {
    padding-right: 3rem; /* Make room for the close button */
}

.alert-close-btn {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    padding: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.alert-close-btn:hover {
    opacity: 1;
}

.alert-close-btn:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Messages container */
.messages-container {
    margin-bottom: 1.5rem;
}

.status-badge {
    padding: 0.25em 0.6em;
    font-size: 0.8em;
    font-weight: 600;
    border-radius: 1em;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Style for the 'Live' status */
.status-badge.status-live {
    background-color: var(--brand-green); /* Uses your existing green variable */
}

.status-badge.status-complete { background-color: var(--brand-green); }
.status-badge.status-error { background-color: #dc3545; }
.status-badge.status-processing { background-color: var(--accent-blue); }
.status-badge.status-queued { background-color: #6c757d; }
.status-badge.status-canceled { background-color: #343a40; }

/* --- Admin Dashboard KPI Styles --- */
.kpi-card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 600;
    font-family: var(--font-heading);
    color: var(--text-color);
    line-height: 1.1;
}

.kpi-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

.kpi-value-danger {
    color: #dc3545; /* Red for danger/errors */
}

/* --- Job Detail Page Styles --- */

.log-box {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    white-space: pre-wrap; /* Allows long lines to wrap */
    word-break: break-all; /* Breaks long strings like S3 keys */
    max-height: 500px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.85em;
}

/* --- Job Detail Page Styles --- */
/* Add this new rule */
.developer-details {
    margin-top: 1.5rem;
}
.developer-details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--accent-blue);
}

.input-file-list {
    list-style-type: none;
    padding-left: 1rem;
    margin: 0;
}
.input-file-list li {
    padding: 0.5rem 0;
    font-family: monospace;
}
.input-file-list li::before {
    content: '📄'; /* Document icon */
    margin-right: 0.75rem;
}

.error-log {
    background-color: #fff0f0; /* Light red background for errors */
    color: #721c24; /* Dark red text */
    border-color: #f5c6cb;
}



/* --- Simple List Style --- */
.simple-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}
.simple-list li {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}
.simple-list li:last-child {
    border-bottom: none;
}

/* ==========================================================================
   ADMIN PANELS & BUILDER STYLES
   ========================================================================== */

/* This is our new, universal style for all white content boxes. */
.content-panel {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
}

/* Header style for panels that have buttons (e.g., "Add Input") */
.content-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.content-panel-header .container-title {
    padding-bottom: 0;
    margin: 0;
}
.container-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.25rem;
}



/* --- 2. Tab Content Pane Visibility --- */
.tab-content > .tab-pane {
    display: none; /* Hide all panes by default */
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 2rem;
}
.tab-content > .tab-pane.show.active {
    display: block; /* Only show the active one */
}



