/* Global Styles */
:root {
    --primary-color: #0078d4;
    --secondary-color: #106ebe;
    --success-color: #107c10;
    --warning-color: #ff8c00;
    --danger-color: #d13438;
    --text-primary: #323130;
    --text-secondary: #605e5c;
    --border-color: #edebe9;
    --bg-light: #faf9f8;
    --bg-white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background-color: var(--bg-light);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* Search Section */
.search-section {
    background-color: var(--bg-white);
    padding: 2rem;
    margin: -2rem auto 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    max-width: 900px;
}

.search-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

.btn-secondary {
    background-color: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

/* Quick Filters */
.quick-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 0.5rem 1rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-chip.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Discover By Section */
.discover-by {
    padding: 3rem 0;
}

.discover-by h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.discover-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.discover-card {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.2s, box-shadow 0.2s;
}

.discover-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.discover-card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.discover-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.discover-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* API List */
.api-list {
    display: grid;
    gap: 1.5rem;
}

.api-card {
    background-color: var(--bg-white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
    transition: box-shadow 0.2s;
}

.api-card:hover {
    box-shadow: var(--shadow-md);
}

.api-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.api-card-title {
    flex: 1;
}

.api-card-title h3 {
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.api-card-title p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.api-card-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-production {
    background-color: #d1f4e0;
    color: var(--success-color);
}

.badge-development {
    background-color: #fef0d9;
    color: var(--warning-color);
}

.badge-deprecated {
    background-color: #f5d6d8;
    color: var(--danger-color);
}

.badge-public {
    background-color: #e6f3ff;
    color: var(--primary-color);
}

.badge-internal {
    background-color: #f0f0f0;
    color: var(--text-secondary);
}

.tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Sidebar Layout */
.sidebar-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    padding: 2rem 0;
}

.sidebar {
    background-color: var(--bg-white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
}

/* Breadcrumb */
.breadcrumb {
    padding: 1rem 0;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* API Detail Page */
.api-detail {
    padding: 2rem 0;
}

.api-header {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.api-title-section {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1.5rem;
}

.api-title-section h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.api-actions {
    display: flex;
    gap: 1rem;
}

.api-metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.metadata-item h4 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.metadata-item p {
    font-weight: 500;
}

.tabs {
    background-color: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.tab-button {
    padding: 1rem 2rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-button:hover {
    background-color: var(--bg-light);
}

.tab-content {
    padding: 2rem;
    display: none;
}

.tab-content.active {
    display: block;
}

/* Access Request */
.access-request-box {
    background-color: #e6f3ff;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.access-request-box h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.access-steps {
    list-style: none;
    counter-reset: step-counter;
}

.access-steps li {
    counter-increment: step-counter;
    margin-bottom: 1rem;
    padding-left: 2.5rem;
    position: relative;
}

.access-steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background-color: var(--primary-color);
    color: white;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: bold;
}

/* Code Block */
.code-block {
    background-color: #282c34;
    color: #abb2bf;
    padding: 1.5rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}

.code-block code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Spec Viewer */
.spec-viewer {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.spec-toolbar {
    background-color: var(--bg-light);
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.spec-content {
    max-height: 600px;
    overflow-y: auto;
    padding: 1.5rem;
    background-color: var(--bg-white);
}

/* Tree View */
.tree-view {
    list-style: none;
    padding-left: 0;
}

.tree-view li {
    margin: 0.5rem 0;
}

.tree-view .nested {
    padding-left: 1.5rem;
    border-left: 1px solid var(--border-color);
    margin-top: 0.5rem;
}

.tree-item {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.tree-item:hover {
    background-color: var(--bg-light);
}

.tree-item.has-children::before {
    content: '▶';
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.tree-item.has-children.expanded::before {
    transform: rotate(90deg);
}

/* Footer */
footer {
    background-color: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    line-height: 2;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    nav ul {
        flex-direction: column;
        gap: 1rem;
    }
}
