/* ============================================================
   GLOBAL STYLES
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================================
   CONTAINER & LAYOUT
   ============================================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* ============================================================
   HEADER
   ============================================================ */

.header {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    sticky: top;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    margin: 0;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    border-bottom: 2px solid transparent;
    padding-bottom: 5px;
}

.nav-link:hover,
.nav-link.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* ============================================================
   HERO SECTION
   ============================================================ */

.hero {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.hero h2 {
    font-size: 32px;
    color: #667eea;
    margin-bottom: 15px;
}

.hero p {
    font-size: 16px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================================
   CARDS SECTION
   ============================================================ */

.cards-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background-color: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.card h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 18px;
}

.card p {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
}

.status-text {
    background-color: #f5f5f5;
    padding: 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #333;
    max-height: 100px;
    overflow-y: auto;
}

.health-card {
    border-left: 4px solid #27ae60;
}

.metrics-card {
    border-left: 4px solid #3498db;
}

.info-card {
    border-left: 4px solid #f39c12;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-success {
    background-color: #27ae60;
    color: white;
    font-size: 16px;
    padding: 12px 24px;
}

.btn-success:hover {
    background-color: #229954;
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* ============================================================
   DATA SECTION
   ============================================================ */

.data-section {
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.data-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.data-header h2 {
    color: #667eea;
    margin: 0;
}

/* ============================================================
   TABLE STYLES
   ============================================================ */

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background-color: #f5f5f5;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    color: #666;
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: #f9f9f9;
    cursor: pointer;
}

.data-table .status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.data-table .status.active {
    background-color: #d4edda;
    color: #155724;
}

.data-table .status.in-progress {
    background-color: #fff3cd;
    color: #856404;
}

.data-table .status.planning {
    background-color: #d1ecf1;
    color: #0c5460;
}

.data-table .progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.data-table .progress-fill {
    height: 100%;
    background-color: #667eea;
    transition: width 0.3s ease;
}

.empty-row {
    text-align: center;
    color: #999;
    font-style: italic;
}

/* ============================================================
   PROJECT DETAILS
   ============================================================ */

.project-details {
    background-color: #f5f5f5;
    border-left: 4px solid #667eea;
    padding: 20px;
    border-radius: 6px;
    margin-top: 20px;
}

.project-details h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.project-details p {
    color: #666;
    line-height: 1.8;
}

/* ============================================================
   DEBUG SECTION
   ============================================================ */

.debug-section {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.debug-details {
    cursor: pointer;
}

.debug-details summary {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
    padding: 10px;
    user-select: none;
}

.debug-details summary:hover {
    color: #5568d3;
}

.debug-content {
    margin-top: 15px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 6px;
}

.debug-item {
    margin-bottom: 12px;
    font-size: 14px;
    padding: 8px;
    background-color: white;
    border-radius: 4px;
    border-left: 3px solid #667eea;
}

.debug-item strong {
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.debug-item span {
    color: #666;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    text-align: center;
    color: #666;
    margin-top: 30px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.footer p {
    margin: 5px 0;
    font-size: 14px;
}

.footer small {
    color: #999;
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .nav {
        gap: 15px;
        justify-content: center;
    }

    .hero {
        padding: 25px;
    }

    .hero h2 {
        font-size: 24px;
    }

    .cards-section {
        grid-template-columns: 1fr;
    }

    .data-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .data-header h2 {
        font-size: 22px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 10px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .btn-success {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }

    .logo {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 15px;
        gap: 20px;
    }

    .hero {
        padding: 15px;
    }

    .hero h2 {
        font-size: 20px;
    }

    .card {
        padding: 15px;
    }

    .data-section {
        padding: 15px;
    }

    .table-wrapper {
        font-size: 11px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 5px;
    }

    .debug-item {
        font-size: 12px;
    }
}

/* ============================================================
   LOADING & STATE STYLES
   ============================================================ */

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loading {
    display: inline-block;
    animation: spin 1s linear infinite;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #f5c6cb;
}

.success {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #c3e6cb;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.hidden {
    display: none !important;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }

.text-center { text-align: center; }
.text-muted { color: #999; }

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
    body {
        background: white;
    }

    .header,
    .footer,
    .btn,
    .debug-section {
        display: none;
    }

    .main-content {
        padding: 0;
    }

    .data-table {
        page-break-inside: avoid;
    }
}
