/* ===========================================
   DreamLook Admin Panel Styles
   =========================================== */

/* --- Base Styles --- */
body {
    background-color: #09090b;
    color: #ffffff;
    font-family: "Inter", sans-serif;
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: #0b0b0d;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px 16px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    display: none;
}

.sidebar.visible {
    display: block;
}

.sidebar .nav-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 16px;
}

.sidebar .nav-tab {
    width: 100%;
    justify-content: flex-start;
}

.content-area {
    margin-left: 260px;
    width: calc(100% - 260px);
    padding-top: 80px; /* clear fixed top bar */
}

@media (max-width: 1024px) {
    .sidebar {
        display: none !important;
    }
    .content-area {
        margin-left: 0;
        width: 100%;
        padding-top: 90px; /* extra top space on smaller screens */
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* --- Modal: Model Create/Edit --- */
#modelModal .glass-panel {
    max-width: 900px;
    margin: 0 auto;
}
#modelModal .form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #a1a1aa;
    margin-bottom: 6px;
}
#modelModal .form-input {
    width: 100%;
    background: #0f0f12;
    border: 1px solid #2f2f36;
    border-radius: 10px;
    padding: 10px 12px;
    color: #fff;
    font-size: 14px;
}
#modelModal input::placeholder {
    color: #6b7280;
}
#modelModal .grid {
    row-gap: 16px;
}
#modelModal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: #0b0b0d;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px 16px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    display: none;
}

.sidebar.visible {
    display: block;
}

.sidebar .nav-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 16px;
}

.sidebar .nav-tab {
    width: 100%;
    justify-content: flex-start;
}

.content-area {
    margin-left: 260px;
    width: calc(100% - 260px);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #09090b;
}
::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3f3f46;
}

/* --- Components --- */
.glass-panel {
    background: #121214;
    background: linear-gradient(
        145deg,
        rgba(18, 18, 20, 0.9) 0%,
        rgba(13, 13, 15, 0.95) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
}

.nav-tab {
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #a1a1aa;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
}
.nav-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}
.nav-tab.active {
    background: #27272a;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* --- Status Indicators --- */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #6b7280;
    transition: all 0.3s ease;
}
.status-dot.active {
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* --- Table Styles --- */
.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.custom-table th {
    background: rgba(255, 255, 255, 0.02);
    padding: 16px 24px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #71717a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.custom-table td {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
    color: #d4d4d8;
    vertical-align: middle;
}
.custom-table tr:last-child td {
    border-bottom: none;
}
.custom-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* --- Login Background Grid --- */
.bg-grid-pattern {
    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.05) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.05) 1px,
            transparent 1px
        );
    background-size: 40px 40px;
    background-position: center top;
}

/* --- Page Content --- */
.page-content {
    display: none;
}
.page-content.active {
    display: block;
}


/* ===========================================
   Live Tasks & Activity Logs Styles
   =========================================== */

/* Status Indicator Dots */
.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.status-queued {
    background-color: #eab308;
    animation: pulse-yellow 2s infinite;
}

.status-indicator.status-processing {
    background-color: #3b82f6;
    animation: pulse-blue 1s infinite;
}

.status-indicator.status-completed {
    background-color: #22c55e;
}

.status-indicator.status-failed {
    background-color: #ef4444;
}

.status-indicator.status-refunded {
    background-color: #f97316;
}

@keyframes pulse-yellow {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(234, 179, 8, 0); }
}

@keyframes pulse-blue {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
}

/* Stat Cards */
.stat-card {
    padding: 16px;
    border-radius: 12px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Loading Spinner */
.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Table Row Hover */
#liveTasksTable tr:hover,
#activityLogsTable tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Active Task Row */
#liveTasksTable tr.bg-blue-900\/10 {
    background-color: rgba(59, 130, 246, 0.05);
}

/* Truncate Text */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Task Detail Modal Scrollbar */
#taskDetailModal .overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

#taskDetailModal .overflow-y-auto::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

#taskDetailModal .overflow-y-auto::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Animate Pulse for Processing Status */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
