/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90e2;
    --primary-dark: #2e5c8a;
    --secondary-color: #e8f4f8;
    --accent-color: #66c2a5;
    --text-dark: #333;
    --text-light: #666;
    --text-muted: #999;
    --border-color: #ddd;
    --success-color: #5cb85c;
    --warning-color: #f0ad4e;
    --danger-color: #d9534f;
    --background-light: #f9f9f9;
    --white: #ffffff;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; margin-top: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* Navigation */
.navbar {
    background-color: var(--primary-dark);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 1px;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.nav-logo:hover {
    opacity: 0.8;
    color: var(--white);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    flex-wrap: nowrap;
}

.nav-menu a {
    color: var(--white);
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    font-size: 0.95rem;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 3rem;
}

.subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 800px;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
}

.page-header h1 {
    color: var(--white);
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.125rem;
    opacity: 0.95;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Sections */
section {
    margin: 3rem 0;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature {
    text-align: center;
    padding: 1.5rem;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

/* Team */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.team-member {
    background: var(--background-light);
    padding: 1rem;
    text-align: center;
    border-radius: 6px;
    font-weight: 500;
}

/* Navigation Cards */
.nav-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.nav-card {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    transition: all 0.3s ease;
    display: block;
}

.nav-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.nav-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.nav-card p {
    color: var(--text-light);
    margin-bottom: 0;
}

/* Info Box */
.info-box {
    background: var(--secondary-color);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 4px;
}

.info-box p {
    margin-bottom: 0.5rem;
}

.info-box p:last-child {
    margin-bottom: 0;
}

/* Requirements */
.requirements-section {
    margin: 3rem 0;
}

.requirement-category {
    margin: 2rem 0;
}

.requirement-category h3 {
    color: var(--primary-dark);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 1.5rem;
}

.requirement {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--background-light);
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.req-id {
    flex-shrink: 0;
    background: var(--primary-color);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 700;
    height: fit-content;
}

.req-content h4 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.req-content p {
    margin-bottom: 0;
}

/* Architecture Components */
.diagram-container {
    margin: 2rem 0;
    padding: 2rem;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow-x: auto;
}

.component {
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.component-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.component-id {
    background: var(--primary-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.875rem;
}

.component-header h3 {
    color: var(--white);
    margin: 0;
}

.component-body {
    padding: 1.5rem;
    background: var(--white);
}

.component-body ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.component-body li {
    margin-bottom: 0.5rem;
}

/* Technology Stack */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tech-item {
    background: var(--background-light);
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid var(--accent-color);
}

.tech-item h4 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.tech-item p {
    color: var(--text-light);
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Design Rationale */
.decision {
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.decision-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.decision-id {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 700;
}

.decision-header h3 {
    color: var(--white);
    margin: 0;
    flex: 1;
}

.decision-content {
    padding: 2rem;
    background: var(--white);
}

.decision-subsection {
    margin-bottom: 1.5rem;
}

.decision-subsection:last-child {
    margin-bottom: 0;
}

.decision-subsection h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Traceability Matrix */
.traceability-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--white);
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

.traceability-table thead {
    background: var(--primary-dark);
    color: var(--white);
}

.traceability-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.traceability-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.traceability-table tbody tr:hover {
    background: var(--background-light);
}

.req-cell {
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

.component-cell {
    font-weight: 600;
    color: var(--accent-color);
    white-space: nowrap;
}

/* Component Coverage */
.coverage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.coverage-item {
    background: var(--background-light);
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid var(--accent-color);
}

.coverage-item h4 {
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
}

.coverage-item p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Validation Stats */
.validation-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.stat-box {
    text-align: center;
    padding: 2rem;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 8px;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.stat-status {
    color: var(--success-color);
    font-weight: 600;
}

.validation-note {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-light);
    font-style: italic;
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer p {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .card-grid,
    .features,
    .nav-cards,
    .tech-grid,
    .coverage-grid {
        grid-template-columns: 1fr;
    }

    .requirement {
        flex-direction: column;
    }

    .container {
        padding: 0 1rem;
    }

    .traceability-table {
        font-size: 0.875rem;
    }

    .traceability-table th,
    .traceability-table td {
        padding: 0.75rem 0.5rem;
    }

    .validation-stats {
        grid-template-columns: 1fr 1fr;
    }

    .stat-number {
        font-size: 2rem;
    }
}

/* Use Cases Styles */
.usecase-intro {
    margin: 2rem 0;
}

.usecase {
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.usecase-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.usecase-id {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 700;
    flex-shrink: 0;
}

.usecase-header h3 {
    color: var(--white);
    margin: 0;
    flex: 1;
}

.usecase-content {
    padding: 2rem;
    background: var(--white);
}

.usecase-subsection {
    margin-bottom: 2rem;
}

.usecase-subsection:last-child {
    margin-bottom: 0;
}

.usecase-subsection h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.usecase-subsection ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.usecase-subsection li {
    margin-bottom: 0.5rem;
}

.usecase-summary {
    margin: 3rem 0;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.summary-card {
    background: var(--background-light);
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.summary-card h3 {
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.summary-card p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.summary-card p:last-child {
    margin-bottom: 0;
}

.actor-roles {
    margin: 3rem 0;
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.role-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.role-card h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.role-card ul {
    margin-left: 1.5rem;
}

.role-card li {
    margin-bottom: 0.75rem;
}

/* Agents Page Styles */
.agents-intro {
    margin: 2rem 0;
}

.agent-principles {
    margin-top: 2rem;
}

.principles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.principle-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.principle-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.principle-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.principle-card p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.agent-module {
    margin-bottom: 4rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.agent-module-header {
    padding: 2rem;
    color: var(--white);
    position: relative;
    text-align: center;
}

.agent-id {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.agent-module-header h2 {
    color: var(--white);
    margin: 0.5rem 0;
    font-size: 2rem;
}

.agent-tagline {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.1rem;
    margin: 0;
    font-style: italic;
}

.agent-module-content {
    padding: 2.5rem;
    background: var(--white);
}

.agent-overview,
.agent-architecture,
.agent-responsibilities,
.agent-interfaces,
.agent-data-flow,
.agent-implementation,
.agent-llm-integration,
.agent-execution-flow,
.agent-approval-flow {
    margin-bottom: 3rem;
}

.agent-overview h3,
.agent-architecture h3,
.agent-responsibilities h3,
.agent-interfaces h3,
.agent-data-flow h3,
.agent-implementation h3,
.agent-llm-integration h3,
.agent-execution-flow h3,
.agent-approval-flow h3 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.responsibilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.responsibility {
    background: var(--background-light);
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid var(--accent-color);
}

.responsibility h4 {
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
}

.responsibility ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.responsibility li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.interface-table,
.comparison-table {
    width: 100%;
    margin-top: 1rem;
    overflow-x: auto;
}

.interface-table table,
.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

.interface-table thead,
.comparison-table thead {
    background: var(--primary-dark);
    color: var(--white);
}

.interface-table th,
.comparison-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.interface-table td,
.comparison-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.interface-table tbody tr:hover,
.comparison-table tbody tr:hover {
    background: var(--background-light);
}

.impl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.impl-item {
    background: var(--background-light);
    padding: 1.5rem;
    border-radius: 6px;
}

.impl-item h4 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.impl-item ul {
    margin-left: 1.5rem;
}

.impl-item li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.agent-comparison {
    margin: 4rem 0;
}

.agent-communication {
    margin: 4rem 0;
}

.comm-legend {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--background-light);
    border-radius: 6px;
}

.comm-legend p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.comm-legend p:last-child {
    margin-bottom: 0;
}

.llm-flow {
    margin-top: 1.5rem;
}

/* Print Styles */
@media print {
    .navbar,
    .footer {
        display: none;
    }

    .hero,
    .page-header {
        background: none;
        color: var(--text-dark);
    }

    .hero h1,
    .page-header h1 {
        color: var(--text-dark);
    }

    .card,
    .component,
    .decision,
    .usecase,
    .agent-module {
        page-break-inside: avoid;
    }
}
