/* ============================================
   KODA Documentation Website - Main Styles
   ============================================ */

:root {
    /* KODA Brand Colors */
    --primary-color: #808080;        /* Gray Stone */
    --secondary-color: #FFFFFF;      /* White */
    --accent-color: #CD7F32;         /* Bronze */
    
    /* UI Colors */
    --text-dark: #2C3E50;
    --text-light: #7F8C8D;
    --bg-light: #F8F9FA;
    --bg-card: #FFFFFF;
    --border-color: #E0E0E0;
    
    /* Status Colors */
    --success: #27AE60;
    --warning: #F39C12;
    --danger: #E74C3C;
    --info: #3498DB;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Inter', sans-serif;
    
    /* Layout */
    --sidebar-width: 280px;
    --header-height: 70px;
    
    /* Transitions */
    --transition-speed: 0.3s;
}

/* ============================================
   Base Styles
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--spacing-sm);
    color: var(--text-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-sm);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: var(--accent-color);
}

ul, ol {
    margin-left: 1.5rem;
    margin-bottom: var(--spacing-sm);
}

code {
    background: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: var(--spacing-sm);
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: var(--spacing-sm);
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-md);
}

table th,
table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
}

table tr:hover {
    background: #f9f9f9;
}

/* ============================================
   Header
   ============================================ */

.site-header {
    background: var(--secondary-color);
    border-bottom: 2px solid var(--border-color);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 var(--spacing-md);
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo img {
    width: 50px;
    height: 50px;
}

.logo h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--primary-color);
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: var(--spacing-xs);
}

.language-switcher button {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-dark);
    cursor: pointer;
    border-radius: 4px;
    transition: all var(--transition-speed) ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.language-switcher button:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.language-switcher button.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    background: var(--secondary-color);
    border-right: 2px solid var(--border-color);
    height: calc(100vh - var(--header-height));
    position: fixed;
    top: var(--header-height);
    left: 0;
    overflow-y: auto;
    padding: var(--spacing-md);
    z-index: 999;
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: calc(var(--header-height) + 1rem);
    left: 1rem;
    background: var(--accent-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 1001;
}

.doc-nav h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-light);
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.doc-nav h3:first-child {
    margin-top: 0;
}

.doc-nav ul {
    list-style: none;
    margin-left: 0;
    margin-bottom: var(--spacing-md);
}

.doc-nav li {
    margin-bottom: 0.5rem;
}

.doc-nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-dark);
    border-radius: 4px;
    transition: all var(--transition-speed) ease;
    font-size: 0.95rem;
}

.doc-nav a:hover {
    background: var(--bg-light);
    padding-left: 1rem;
    color: var(--accent-color);
}

.doc-nav a.active {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
}

/* ============================================
   Main Content
   ============================================ */

.main-layout {
    display: flex;
}

.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: var(--spacing-lg);
    max-width: 1000px;
    min-height: calc(100vh - var(--header-height));
}

/* Hero Section */
.hero {
    text-align: center;
    padding: var(--spacing-xl) 0;
    margin-bottom: var(--spacing-lg);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-lg);
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.stat-card {
    background: white;
    padding: var(--spacing-md);
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform var(--transition-speed) ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card i {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: var(--spacing-sm);
}

.stat-card .number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card .label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
}

/* Document Categories */
.document-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.category-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform var(--transition-speed) ease;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card .card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.category-card .card-header i {
    font-size: 2rem;
    color: var(--accent-color);
}

.category-card .card-header h3 {
    margin: 0;
}

.category-card p {
    color: var(--text-light);
    margin-bottom: var(--spacing-md);
}

.feature-list {
    list-style: none;
    margin-left: 0;
    margin-bottom: var(--spacing-md);
}

.feature-list li {
    padding: 0.5rem 0;
    color: var(--text-dark);
}

.feature-list i {
    color: var(--success);
    margin-right: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: none;
    font-size: 1rem;
}

.btn i {
    margin-left: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-color);
}

.btn-secondary {
    background: var(--accent-color);
    color: white;
}

.btn-secondary:hover {
    background: var(--primary-color);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Document Content */
.document-content {
    background: white;
    padding: var(--spacing-lg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.document-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.document-meta {
    display: flex;
    gap: var(--spacing-md);
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: var(--spacing-sm);
}

.document-meta i {
    margin-right: 0.25rem;
}

.document-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-light);
    font-size: 0.9rem;
}

.breadcrumb .separator {
    color: var(--text-light);
}

.breadcrumb .current {
    color: var(--text-dark);
    font-weight: 600;
}

/* Table of Contents */
.table-of-contents {
    background: var(--bg-light);
    padding: var(--spacing-md);
    border-radius: 6px;
    border-left: 4px solid var(--accent-color);
    margin-bottom: var(--spacing-lg);
}

.table-of-contents h2 {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-sm);
}

.table-of-contents ul {
    margin-bottom: 0;
}

.table-of-contents a {
    color: var(--primary-color);
}

.table-of-contents a:hover {
    color: var(--accent-color);
}

/* Document Navigation */
.document-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 2px solid var(--border-color);
}

.nav-prev,
.nav-next {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-light);
    border-radius: 6px;
    transition: background var(--transition-speed) ease;
}

.nav-prev:hover,
.nav-next:hover {
    background: var(--primary-color);
    color: white;
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
    background: var(--secondary-color);
    border-top: 2px solid var(--border-color);
    padding: var(--spacing-lg) 0;
    text-align: center;
    color: var(--text-light);
    margin-top: var(--spacing-xl);
}

.site-footer .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.site-footer p {
    margin-bottom: 0.5rem;
}

/* ============================================
   Back to Top Button
   ============================================ */

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed) ease, 
                visibility var(--transition-speed) ease,
                transform var(--transition-speed) ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

/* ============================================
   Quick Info Section
   ============================================ */

.quick-info {
    background: white;
    padding: var(--spacing-lg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: var(--spacing-lg);
}

.quick-info h2 {
    margin-bottom: var(--spacing-md);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.info-item {
    background: var(--bg-light);
    padding: var(--spacing-md);
    border-radius: 6px;
}

.info-item strong {
    color: var(--accent-color);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-speed) ease;
        width: 280px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .content {
        margin-left: 0;
        padding: var(--spacing-sm);
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .document-categories {
        grid-template-columns: 1fr;
    }
    
    .document-actions {
        flex-direction: column;
    }
    
    .document-navigation {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .logo h1 {
        font-size: 1.2rem;
    }
    
    .language-switcher button {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }
    
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.2rem; }
    
    .stat-card .number {
        font-size: 2rem;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
}

/* ============================================
   Loading Indicator
   ============================================ */

.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Scrollbar Styling
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* ========================================
   Task Management System Styles
   ======================================== */

/* Phase Sections */
.phase-section {
    margin-bottom: 3rem;
}

.phase-header {
    background: linear-gradient(135deg, #808080, #CD7F32);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.phase-header h2 {
    color: white;
    margin: 0 0 1rem 0;
    font-size: 1.8rem;
}

.phase-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Package Wrapper */
.package-wrapper {
    background: white;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    margin-bottom: 2rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.package-title-bar {
    background: var(--bg-light);
    padding: 1.25rem 1.5rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.package-title-bar h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-dark);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.package-title-bar i {
    color: var(--accent-color);
}

.package-hours-badge {
    background: #F39C12;
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 15px;
    font-weight: 700;
    font-size: 0.95rem;
}

.package-meta-info {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-bottom: 2px dashed var(--border-color);
    display: flex;
    gap: 2rem;
    font-size: 0.95rem;
    color: var(--text-light);
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-item i {
    color: var(--info);
}

/* Tasks Grid */
.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

/* Task Cards */
.task-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 5px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.task-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Task Priority Border Colors */
.task-card[data-priority="critical"] {
    border-left-color: #E74C3C;
}

.task-card[data-priority="high"] {
    border-left-color: #F39C12;
}

.task-card[data-priority="medium"] {
    border-left-color: #3498DB;
}

.task-card[data-priority="enhancement"] {
    border-left-color: #27AE60;
}

.task-card[data-priority="buffer"] {
    border-left-color: #9B59B6;
    background: #f9f5ff;
}

/* Task Header */
.task-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.task-id-badge {
    background: linear-gradient(135deg, #808080, #CD7F32);
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.task-time-badge {
    background: #F39C12;
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.task-priority-badge {
    padding: 0.4rem 0.9rem;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.priority-critical {
    background: #E74C3C;
    color: white;
}

.priority-high {
    background: #F39C12;
    color: white;
}

.priority-medium {
    background: #3498DB;
    color: white;
}

.priority-enhancement {
    background: #27AE60;
    color: white;
}

.priority-buffer {
    background: #9B59B6;
    color: white;
}

/* Task Title */
.task-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.4;
}

/* Task Description */
.task-description {
    flex: 1;
    margin-bottom: 1rem;
}

.task-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.task-checklist li {
    padding: 0.45rem 0;
    color: var(--text-dark);
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    line-height: 1.6;
}

.task-checklist li i {
    color: #27AE60;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Task Footer */
.task-footer {
    border-top: 1px solid #e8e8e8;
    padding-top: 1rem;
    margin-top: auto;
}

.task-meta {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.milestone-tag,
.dependency-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.milestone-tag i {
    color: #3498DB;
}

.dependency-tag i {
    color: #F39C12;
}

/* Alert Boxes Enhancement */
.alert {
    padding: 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-info {
    background: #EBF5FB;
    border-left-color: #3498DB;
    color: #2874A6;
}

.alert-warning {
    background: #FEF5E7;
    border-left-color: #F39C12;
    color: #9A7D0A;
}

.alert-success {
    background: #EAFAF1;
    border-left-color: #27AE60;
    color: #1D8348;
}

.alert-danger {
    background: #FDEDEC;
    border-left-color: #E74C3C;
    color: #B03A2E;
}

/* Responsive Adjustments for Task System */
@media (max-width: 1200px) {
    .tasks-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tasks-grid {
        padding: 1rem;
    }
    
    .task-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .phase-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .package-title-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .package-meta-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .phase-header {
        padding: 1rem 1.5rem;
    }
    
    .phase-header h2 {
        font-size: 1.4rem;
    }
}