/* Enhanced common.css with comprehensive header and sidebar styles */

:root {
    --primary-color: #2563eb;
    --secondary-color: #f8fafc;
    --accent-color: #059669;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --sidebar-width: 280px;
    --header-height: 64px;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
}

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

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

/* ===== HEADER STYLES ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.header-logo {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 20px;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.header-logo:hover {
    text-decoration: none;
    color: var(--primary-color);
}

.header-logo i {
    margin-right: 12px;
    font-size: 24px;
}

.breadcrumb {
    margin-left: 40px;
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
    flex: 1;
}

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

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

.breadcrumb-separator {
    margin: 0 8px;
    font-size: 12px;
}

.header-search {
    max-width: 300px;
    margin-left: auto;
    margin-right: 20px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 8px 12px 8px 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-primary);
    margin-left: auto;
    transition: color 0.2s;
}

.mobile-menu-toggle:hover {
    color: var(--primary-color);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: var(--secondary-color);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.search-result-description {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== SIDEBAR STYLES ===== */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--secondary-color);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 999;
    transition: transform 0.3s ease;
}

.sidebar-content {
    padding: 24px 0;
}

.nav-section {
    margin-bottom: 32px;
}

.nav-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 24px;
    margin-bottom: 12px;
}

.nav-item {
    display: block;
    padding: 8px 24px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary-color);
    text-decoration: none;
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.nav-item i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
}

/* ===== MAIN CONTENT STYLES ===== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    background: white;
}

.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px;
}

.page-header {
    margin-bottom: 40px;
}

.page-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.page-description {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.content-section {
    margin-bottom: 48px;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.subsection-title {
    font-size: 20px;
    font-weight: 600;
    margin: 32px 0 16px 0;
    color: var(--text-primary);
}

.content-section p {
    margin-bottom: 16px;
    line-height: 1.7;
}

.content-section ul, .content-section ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.content-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* ===== INFO BOXES ===== */
.info-box {
    padding: 20px;
    border-radius: 8px;
    margin: 24px 0;
    border-left: 4px solid;
}

.info-box.info {
    background-color: #eff6ff;
    border-left-color: var(--primary-color);
}

.info-box.success {
    background-color: #ecfdf5;
    border-left-color: var(--success-color);
}

.info-box.warning {
    background-color: #fffbeb;
    border-left-color: var(--warning-color);
}

.info-box.error {
    background-color: #fef2f2;
    border-left-color: var(--error-color);
}

.info-box-title {
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.info-box-title i {
    margin-right: 8px;
}

.info-box.info .info-box-title {
    color: var(--primary-color);
}

.info-box.success .info-box-title {
    color: var(--success-color);
}

.info-box.warning .info-box-title {
    color: var(--warning-color);
}

.info-box.error .info-box-title {
    color: var(--error-color);
}

/* ===== STEP CARDS ===== */
.step-cards {
    display: grid;
    gap: 24px;
    margin: 32px 0;
}

.step-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.step-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.step-number {
    position: absolute;
    top: -12px;
    left: 24px;
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}

.step-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.step-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== CONFIG GRID ===== */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

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

.config-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.config-card i {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.config-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.config-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.config-card ul {
    font-size: 14px;
    color: var(--text-secondary);
    padding-left: 16px;
}

.config-card ul li {
    margin-bottom: 4px;
}

/* ===== TABLES ===== */
.table-container {
    overflow-x: auto;
    margin: 24px 0;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--secondary-color);
    font-weight: 600;
    color: var(--text-primary);
}

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

/* ===== PAGE NAVIGATION ===== */
.page-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background: var(--secondary-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.nav-link:hover {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.nav-link i {
    font-size: 14px;
}

.nav-link.prev i {
    margin-right: 8px;
}

.nav-link.next i {
    margin-left: 8px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .header-search {
        display: none;
    }

    .breadcrumb {
        display: none;
    }

    .header-logo {
        font-size: 18px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .page-title {
        font-size: 28px;
    }

    .page-description {
        font-size: 16px;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    .content-wrapper {
        padding: 20px 16px;
    }

    .page-navigation {
        flex-direction: column;
        gap: 12px;
    }

    .nav-link {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0 16px;
    }

    .sidebar-content {
        padding: 16px 0;
    }

    .nav-section {
        margin-bottom: 24px;
    }

    .content-wrapper {
        padding: 16px 12px;
    }

    .page-title {
        font-size: 24px;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

/* ===== PRINT STYLES ===== */
@media print {
    .header,
    .sidebar,
    .mobile-menu-toggle,
    .page-navigation {
        display: none;
    }

    .main-content {
        margin-left: 0;
        margin-top: 0;
    }

    .content-wrapper {
        max-width: none;
        padding: 0;
    }
}