/* TankerMade Developer Dashboard - Main Styles */
/* Based on UI Component Library and Responsive Design Guidelines */

/* CSS Custom Properties (Design System) */
:root {
    /* Colors - Developer Dashboard Theme */
    --color-primary: #6366F1;
    --color-primary-hover: #5B21B6;
    --color-secondary: #64748B;

    /* Background Colors */
    --color-bg-primary: #FFFFFF;
    --color-bg-secondary: #F1F5F9;
    --color-bg-tertiary: #E2E8F0;

    /* Header & Navigation */
    --color-header: #1F2937;
    --color-sidebar: #374151;
    --color-sidebar-hover: #4B5563;

    /* Text Colors */
    --color-text-primary: #1E293B;
    --color-text-secondary: #64748B;
    --color-text-tertiary: #94A3B8;
    --color-text-inverse: #FFFFFF;

    /* Status Colors */
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --color-info: #3B82F6;

    /* Border Colors */
    --color-border: #E2E8F0;
    --color-border-focus: #6366F1;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', Menlo, Monaco, 'Cascadia Code', monospace;

    /* Font Sizes */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */

    /* Spacing */
    --space-1: 0.25rem;      /* 4px */
    --space-2: 0.5rem;       /* 8px */
    --space-3: 0.75rem;      /* 12px */
    --space-4: 1rem;         /* 16px */
    --space-5: 1.25rem;      /* 20px */
    --space-6: 1.5rem;       /* 24px */
    --space-8: 2rem;         /* 32px */
    --space-12: 3rem;        /* 48px */

    /* Layout */
    --sidebar-width: 240px;
    --header-height: 64px;
    --footer-height: 48px;
    --bottom-nav-height: 64px;

    /* Breakpoints (for JS usage) */
    --breakpoint-mobile: 640px;
    --breakpoint-tablet: 1024px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

/* Reset and Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    overflow-x: hidden;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--color-primary);
    color: var(--color-text-inverse);
    padding: var(--space-2) var(--space-4);
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 6px;
}

/* Application Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--color-header);
    color: var(--color-text-inverse);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6);
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    flex: 1;
}

.logo {
    font-size: var(--text-2xl);
    font-weight: 700;
    white-space: nowrap;
}

.breadcrumb ol {
    display: flex;
    list-style: none;
    gap: var(--space-2);
    align-items: center;
}

.breadcrumb li:not(:first-child)::before {
    content: '/';
    margin-right: var(--space-2);
    color: var(--color-text-tertiary);
}

.breadcrumb a {
    color: var(--color-text-inverse);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.breadcrumb a:hover {
    opacity: 1;
}

.breadcrumb li[aria-current="page"] {
    opacity: 1;
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 2;
}

.status-overview {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    background: rgba(255, 255, 255, 0.1);
    padding: var(--space-2) var(--space-4);
    border-radius: 8px;
}

.current-phase {
    font-weight: 600;
    font-size: var(--text-sm);
}

.progress-mini {
    width: 100px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-success);
    transition: width var(--transition-normal);
}

.progress-text {
    font-size: var(--text-sm);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
    justify-content: flex-end;
}

.header-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--color-text-inverse);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    position: relative;
}

.header-action:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-action:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.icon {
    font-size: var(--text-lg);
}

.incidents-badge .badge-count {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--color-error);
    color: var(--color-text-inverse);
    font-size: var(--text-xs);
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--space-1);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text-inverse);
    font-size: var(--text-xl);
    cursor: pointer;
    padding: var(--space-2);
}

/* Main Application Container */
.app-container {
    display: flex;
    /* margin-top: var(--header-height); */
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--color-sidebar);
    color: var(--color-text-inverse);
    padding: var(--space-6) 0;
    overflow-y: auto;
    transition: transform var(--transition-normal);
}

.nav-section {
    padding: 0 var(--space-4);
    margin-bottom: var(--space-6);
}

.nav-section-title {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: var(--space-3);
    padding: 0 var(--space-4);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-1);
    color: var(--color-text-inverse);
    text-decoration: none;
    border-radius: 6px;
    transition: background-color var(--transition-fast);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    position: relative;
}

.nav-item:hover {
    background-color: var(--color-sidebar-hover);
}

.nav-item.active {
    background-color: var(--color-primary);
}

.nav-item:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.nav-icon {
    font-size: var(--text-lg);
    min-width: 24px;
}

.nav-text {
    font-weight: 500;
}

.nav-badge {
    margin-left: auto;
    background: var(--color-error);
    color: var(--color-text-inverse);
    font-size: var(--text-xs);
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--space-2);
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: var(--space-6);
    overflow-y: auto;
    background-color: var(--color-bg-secondary);
}

#content-container {
    background: var(--color-bg-primary);
    border-radius: 12px;
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    min-height: 500px;
}

/* Loading and Error States */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-12);
    color: var(--color-text-secondary);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-border);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-12);
    text-align: center;
}

.error-icon {
    font-size: 3rem;
}

.retry-btn {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    border: none;
    padding: var(--space-3) var(--space-6);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color var(--transition-fast);
}

.retry-btn:hover {
    background: var(--color-primary-hover);
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--color-bg-primary);
    border-top: 1px solid var(--color-border);
    z-index: 90;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    color: var(--color-text-secondary);
    text-decoration: none;
    padding: var(--space-2);
    transition: color var(--transition-fast);
    position: relative;
}

.bottom-nav-item.active {
    color: var(--color-primary);
}

.bottom-nav-icon {
    font-size: var(--text-lg);
}

.bottom-nav-text {
    font-size: var(--text-xs);
    font-weight: 500;
}

.bottom-nav-badge {
    position: absolute;
    top: 8px;
    right: 12px;
    background: var(--color-error);
    color: var(--color-text-inverse);
    font-size: var(--text-xs);
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--space-1);
}

/* Footer */
.app-footer {
    height: var(--footer-height);
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--space-6);
}

.footer-content {
    display: flex;
    gap: var(--space-6);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }

.hidden { display: none !important; }
.visible { display: block !important; }

/* 
 * APPEND THESE STYLES TO YOUR EXISTING docs/styles/app.css FILE
 * These are the GitHub Authentication styles to add at the end
 */

/* GitHub Authentication Styles */
.auth-section {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.github-login-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: #24292f;
    color: white;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.github-login-btn:hover {
    background: #32383f;
    border-color: #8b949e;
}

.github-login-btn:focus {
    outline: 2px solid #0969da;
    outline-offset: 2px;
}

.github-icon {
    fill: currentColor;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-details {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.user-name {
    color: var(--color-text-inverse);
    font-size: var(--text-sm);
    font-weight: 500;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.logout-btn svg {
    fill: currentColor;
}

/* Protected content styles */
.access-denied {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    padding: var(--space-12);
}

.access-denied .icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

/* Task feedback animations */
.task-feedback {
    position: absolute;
    top: 0;
    right: -24px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: bold;
    animation: feedbackPulse 2s ease-out forwards;
}

.task-feedback.success {
    background: var(--color-success);
    color: white;
}

.task-feedback.error {
    background: var(--color-error);
    color: white;
}

@keyframes feedbackPulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Loading states for checkboxes */
input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive adjustments for auth section */
@media (max-width: 639px) {
    .github-login-btn {
        padding: var(--space-2);
        font-size: var(--text-xs);
    }

    .github-login-btn span:not(.icon) {
        display: none;
    }

    .user-details {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-1);
    }

    .user-name {
        font-size: var(--text-xs);
    }
}

/* 
 * APPEND THESE STYLES TO YOUR EXISTING docs/styles/app.css FILE
 * These styles are for the authentication-based navigation
 */

/* Auth prompt card in sidebar */
.auth-prompt-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: var(--space-4);
    text-align: center;
    margin: var(--space-4);
}

.auth-prompt-icon {
    font-size: 2rem;
    margin-bottom: var(--space-2);
    opacity: 0.7;
}

.auth-prompt-card h3 {
    color: var(--color-text-inverse);
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.auth-prompt-card p {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--text-sm);
    line-height: 1.4;
    margin-bottom: var(--space-4);
}

.auth-prompt-card .btn {
    width: 100%;
}

/* Protected navigation sections */
.nav-protected {
    transition: opacity var(--transition-normal);
}

/* Bottom navigation protected items */
.bottom-nav-protected {
    display: flex;
    align-items: center;
    flex: 1;
}

.bottom-nav-protected .bottom-nav-item {
    flex: 1;
}

/* Responsive adjustments */
@media (max-width: 639px) {
    .auth-prompt-card {
        margin: var(--space-2);
        padding: var(--space-3);
    }

    .auth-prompt-card h3 {
        font-size: var(--text-sm);
    }

    .auth-prompt-card p {
        font-size: var(--text-xs);
    }
}

/* TARGETED STATUS OVERVIEW FIX - Only affects header, not dashboard */

/* Only target the header status-overview, not dashboard cards */
.app-header .status-overview,
.header-content .status-overview,
header .status-overview {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    min-width: 300px !important;
    max-width: 400px !important;
    height: auto !important;
    padding: 8px 0 !important;
    position: relative !important;
}

/* Header progress text - only target within header */
.app-header .status-overview .progress-text,
.header-content .status-overview .progress-text,
header .status-overview .progress-text {
    display: block !important;
    position: static !important;
    float: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
    text-align: right !important;
    margin-right: 5px !important;
    padding: 0 !important;
    line-height: 1.4 !important;
    vertical-align: baseline !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    min-width: 80px !important;
}

/* Header current phase - only target within header */
.app-header .status-overview .current-phase,
.header-content .status-overview .current-phase,
header .status-overview .current-phase {
    display: block !important;
    position: static !important;
    float: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 0 1 auto !important;
    text-align: left !important;
    margin-left: 5px !important;
    padding: 0 !important;
    line-height: 1.4 !important;
    vertical-align: baseline !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
}

/* Header progress bar - only target within header */
.app-header .status-overview .progress-mini,
.header-content .status-overview .progress-mini,
header .status-overview .progress-mini {
    display: block !important;
    position: static !important;
    float: none !important;
    flex: 1 1 100px !important;
    height: 4px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 2px !important;
    overflow: hidden !important;
    margin: 0 8px !important;
    padding: 0 !important;
    vertical-align: baseline !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
}

/* RESTORE NORMAL BEHAVIOR FOR DASHBOARD CARDS */
/* Allow dashboard progress-text to have normal behavior */
.dashboard-card .progress-text,
.card .progress-text,
.phase-mini-card .progress-text {
    position: static !important;
    transform: none !important;
    transition: all 0.2s ease !important;
    /* Remove the !important declarations that were breaking hover effects */
}

/* Ensure dashboard cards can still have hover effects */
.dashboard-card:hover .progress-text,
.card:hover .progress-text,
.phase-mini-card:hover .progress-text {
    /* Allow normal hover behavior */
    position: static;
    transform: none;
}

/* If dashboard cards need specific hover transforms, add them here */
.dashboard-card:hover {
    transform: translateY(-2px);
}

.phase-mini-card:hover {
    transform: scale(1.02);
}

/* Responsive - only for header */
@media (max-width: 480px) {
    .app-header .status-overview,
    .header-content .status-overview,
    header .status-overview {
        flex-direction: column !important;
        gap: 4px !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .app-header .status-overview .current-phase,
    .app-header .status-overview .progress-text,
    .header-content .status-overview .current-phase,
    .header-content .status-overview .progress-text,
    header .status-overview .current-phase,
    header .status-overview .progress-text {
        text-align: center !important;
        font-size: 12px !important;
    }

    .app-header .status-overview .progress-mini,
    .header-content .status-overview .progress-mini,
    header .status-overview .progress-mini {
        width: 100% !important;
        margin: 2px 0 !important;
    }
}