/* ============================================
   Ball DevOps Documentation - Styles
   Static Web App for Azure Static Web Apps
   ============================================ */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --code-bg: #f1f5f9;
    --sidebar-width: 280px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--background);
}

/* ============================================
   Sidebar Navigation
   ============================================ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.sidebar-logo-text {
    font-size: 1.1rem;
    font-weight: 700;
}

.sidebar-logo-subtitle {
    font-size: 0.7rem;
    opacity: 0.8;
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-section {
    padding: 0.5rem 1.5rem;
    margin-top: 0.5rem;
}

.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.sidebar-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-item {
    margin: 0.25rem 0;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav-link:hover {
    background: var(--code-bg);
    color: var(--primary-color);
}

.sidebar-nav-link.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.sidebar-nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* ============================================
   Main Content Area
   ============================================ */

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 2rem 3rem;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--surface);
    padding: 3rem 4rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* ============================================
   Index Page Specific
   ============================================ */

.index-container {
    max-width: 1000px;
    margin: 0 auto;
}

.hero {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 16px;
    color: white;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    border: none;
    padding: 0;
    color: white;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    color: white;
    margin: 0;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.breadcrumbs a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs-separator {
    color: var(--border-color);
}

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

.card {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: block;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgb(0 0 0 / 0.15);
    border-color: var(--primary-light);
}

.card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.card-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   Typography
   ============================================ */

h1 {
    color: var(--primary-color);
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
}

h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

h4 {
    color: var(--secondary-color);
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   Tables
   ============================================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

thead {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

tbody tr:hover {
    background-color: #f1f5f9;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:nth-child(even) {
    background-color: #fafafa;
}

tbody tr:nth-child(even):hover {
    background-color: #f1f5f9;
}

/* ============================================
   Lists
   ============================================ */

ul, ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    list-style: none;
    position: relative;
    padding-left: 0.5rem;
}

ul > li::before {
    content: "▸";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: -1rem;
}

/* ============================================
   Code
   ============================================ */

code {
    background: var(--code-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 0.875em;
    color: var(--primary-dark);
}

pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* ============================================
   Horizontal Rule
   ============================================ */

hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, var(--border-color), transparent);
    margin: 2rem 0;
}

/* ============================================
   Links
   ============================================ */

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

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

/* ============================================
   Mermaid Diagrams
   ============================================ */

.mermaid-diagram {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
    padding: 1.5rem;
    background: #fafbfc;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.mermaid-diagram svg {
    max-width: 100%;
    height: auto;
}

.mermaid-error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 1rem;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.875rem;
    margin: 1rem 0;
}

/* ============================================
   Checkboxes
   ============================================ */

input[type="checkbox"] {
    width: 1.1em;
    height: 1.1em;
    margin-right: 0.5rem;
    accent-color: var(--primary-color);
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        padding: 0;
    }
    
    table {
        box-shadow: none;
    }
    
    .mermaid-diagram {
        break-inside: avoid;
    }
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }
    
    .main-content {
        padding: 1.5rem 2rem;
    }
    
    .container {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .container {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    table {
        font-size: 0.8rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
    
    .mermaid-diagram {
        padding: 0.5rem;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    width: 44px;
    height: 44px;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }
}

/* Overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.open {
    display: block;
}

/* ============================================
   Animations
   ============================================ */

h2:target {
    animation: highlight 2s ease;
}

@keyframes highlight {
    0% { background-color: #fef08a; }
    100% { background-color: transparent; }
}
