/* Custom Variables */
:root {
    --primary-color: #4A9EFF;
    --accent-color: #FF6B35;
    --dark-bg: #1a1a1a;
    --darker-bg: #0f0f0f;
    --text-light: #ffffff;
    --text-muted: #b0b0b0;
    --text-dark: #333333;
    --primary-gradient: linear-gradient(135deg, var(--primary-color) 0%, #3A8EEF 100%);
    --accent-gradient: linear-gradient(135deg, var(--accent-color) 0%, #E55A2B 100%);
    --dark-gradient: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 100%);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --hover-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    --border-radius: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-light);
    background-color: var(--dark-bg);
    scroll-behavior: smooth;
}

/* Hero Section */
.hero-section {
    background: var(--dark-gradient);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(74, 158, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 107, 53, 0.05) 0%, transparent 50%);
    opacity: 0.8;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding-top: 100px;
}

.hero-graphic {
    position: relative;
    z-index: 2;
}

.hero-icon {
    font-size: 15rem;
    opacity: 0.2;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Navigation */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(15, 15, 15, 0.95) !important;
    transition: var(--transition);
    border-bottom: 1px solid rgba(74, 158, 255, 0.2);
}

.navbar-brand {
    font-size: 1.5rem;
    color: var(--text-light) !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.navbar-nav .nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 1rem;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link.active {
    color: var(--accent-color) !important;
    border-bottom: 2px solid var(--accent-color);
}

/* Stats Section */
.stats-section {
    background: var(--darker-bg);
    padding: 4rem 0;
    margin-top: -50px;
    position: relative;
    z-index: 3;
    border-top: 1px solid rgba(74, 158, 255, 0.1);
}

.stat-card {
    background: var(--dark-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    text-align: center;
    transition: var(--transition);
    height: 100%;
    border: 1px solid rgba(74, 158, 255, 0.1);
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.5rem;
}

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

.stat-label {
    color: var(--text-muted);
    margin: 0;
}

/* Main Content */
.main-content {
    padding: 6rem 0;
}

.content-section {
    margin-bottom: 6rem;
}

.section-header {
    margin-bottom: 4rem;
}

/* Feature Cards */
.feature-card {
    background: var(--dark-bg);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border: 1px solid rgba(74, 158, 255, 0.1);
}

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

.feature-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: white;
    font-size: 2rem;
}

.feature-card h4 {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-weight: 600;
}

.feature-card p {
    color: var(--text-muted);
    margin: 0;
}

/* Authentication Section */
.auth-card {
    background: var(--dark-bg);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(74, 158, 255, 0.1);
}

.auth-method {
    border-bottom: 1px solid #eee;
    padding-bottom: 2rem;
}

.auth-method:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Endpoint Styles */
.endpoint-group {
    margin-bottom: 3rem;
}

.endpoint-group-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #e9ecef;
}

.endpoint-card {
    background: var(--dark-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(74, 158, 255, 0.1);
}

.endpoint-card:hover {
    box-shadow: var(--hover-shadow);
}

.endpoint-header {
    padding: 1.5rem 2rem;
    background: var(--darker-bg);
    border-bottom: 1px solid rgba(74, 158, 255, 0.1);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    min-height: 44px; /* Minimum touch target size for mobile */
}

.endpoint-header:hover {
    background: rgba(74, 158, 255, 0.05);
}

.endpoint-header:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

.endpoint-body {
    padding: 2rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.endpoint-card.active .endpoint-body {
    max-height: 1000px;
    transition: max-height 0.4s ease-in, padding 0.3s ease-in;
}

.http-method {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    margin-right: 1rem;
}

.http-method.get { background: #28a745; color: white; }
.http-method.post { background: #007bff; color: white; }
.http-method.put { background: #ffc107; color: #333; }
.http-method.delete { background: #dc3545; color: white; }

.endpoint-path {
    font-family: 'Fira Code', monospace;
    font-weight: 500;
    color: var(--text-light);
}

.endpoint-description {
    color: var(--text-muted);
    margin: 0.5rem 0 0 0;
}

/* Dropdown Indicator */
.dropdown-indicator {
    transition: transform 0.3s ease;
    color: var(--text-muted);
    cursor: pointer;
}

.endpoint-card.active .dropdown-indicator {
    transform: rotate(180deg);
    color: var(--text-light);
}

.endpoint-header:hover .dropdown-indicator {
    color: var(--primary-color);
}

.param-item {
    padding: 1rem;
    background: var(--darker-bg);
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid rgba(74, 158, 255, 0.05);
}

.param-item strong {
    color: var(--text-light);
}

/* Code Blocks */
.code-block {
    background: #2d3748;
    border-radius: 8px;
    overflow: hidden;
    margin: 1rem 0;
}

.code-block pre {
    margin: 0;
    padding: 1.5rem;
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.code-block code {
    background: transparent;
    color: inherit;
    font-family: 'Fira Code', monospace;
}

/* Schema Cards */
.schema-card {
    background: var(--dark-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    height: 100%;
    border: 1px solid rgba(74, 158, 255, 0.1);
}

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

.schema-card h4 {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.schema-card h4::before {
    content: '\f0c0';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 0.5rem;
    color: var(--primary-color);
}

/* API Tester */
.api-tester {
    background: var(--dark-bg);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(74, 158, 255, 0.1);
}

.response-section {
    background: var(--darker-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-top: 2rem;
    border: 1px solid rgba(74, 158, 255, 0.05);
}

.response-status {
    margin-bottom: 1rem;
}

/* Form Styling */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid rgba(74, 158, 255, 0.2);
    padding: 0.75rem 1rem;
    transition: var(--transition);
    background-color: var(--dark-bg);
    color: var(--text-light);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(74, 158, 255, 0.25);
    background-color: var(--darker-bg);
    color: var(--text-light);
}

.form-label {
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

/* Button Styling */
.btn {
    border-radius: 8px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    min-height: 44px; /* Minimum touch target size for mobile */
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-outline-light {
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    background: transparent;
}

.btn-outline-light:hover {
    background: var(--accent-color);
    color: var(--text-light);
    transform: translateY(-2px);
}

/* Badges */
.badge {
    border-radius: 6px;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

/* Footer */
footer {
    background: var(--darker-bg) !important;
    margin-top: 6rem;
    border-top: 1px solid rgba(74, 158, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content {
        text-align: center;
        padding-top: 120px;
    }

    .hero-icon {
        font-size: 6rem;
    }

    .display-4 {
        font-size: 2rem !important;
        line-height: 1.2;
    }

    .lead {
        font-size: 1rem;
    }

    .stats-section {
        padding: 2rem 0;
        margin-top: -30px;
    }

    .main-content {
        padding: 2rem 0;
    }

    .content-section {
        margin-bottom: 2rem;
    }

    .endpoint-header,
    .endpoint-body {
        padding: 1rem;
    }

    .endpoint-path {
        font-size: 0.75rem;
        word-break: break-all;
    }

    .api-tester {
        padding: 1.5rem;
    }

    .stat-card {
        margin-bottom: 1rem;
    }

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

    .feature-card,
    .auth-card,
    .schema-card {
        padding: 1.5rem;
    }

    .code-block {
        overflow-x: auto;
    }

    .code-block pre {
        font-size: 0.75rem;
        white-space: pre;
        overflow-x: auto;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .navbar-nav .nav-link {
        margin: 0;
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .hero-content {
        padding-top: 100px;
    }

    .hero-icon {
        font-size: 4rem;
    }

    .display-4 {
        font-size: 1.75rem !important;
    }

    .hero-content .btn {
        margin-bottom: 1rem;
    }

    .endpoint-group-title {
        font-size: 1.5rem;
    }

    .endpoint-header {
        padding: 0.75rem;
    }

    .endpoint-body {
        padding: 0.75rem;
    }

    .http-method {
        margin-right: 0.5rem;
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    .badge {
        font-size: 0.625rem;
        padding: 0.25rem 0.5rem;
    }

    .section-header h2 {
        font-size: 2rem !important;
    }

    .navbar-toggler {
        padding: 0.25rem 0.5rem;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .d-flex.flex-wrap.gap-3 {
        gap: 0.5rem !important;
    }

    .d-flex.flex-wrap.gap-3 .badge {
        margin-bottom: 0.5rem;
    }

    .hero-content .d-flex.flex-wrap.gap-3 {
        justify-content: center;
    }

    .endpoint-path {
        line-height: 1.3;
        overflow-wrap: break-word;
    }

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

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-gradient);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Loading Animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    animation: pulse 1.5s infinite;
}

/* Success/Error States */
.status-success {
    background: #d4edda !important;
    color: #155724;
    border-color: #c3e6cb;
}

.status-error {
    background: #f8d7da !important;
    color: #721c24;
    border-color: #f5c6cb;
}

/* Interactive Elements */
.endpoint-card {
    cursor: pointer;
    user-select: none;
}

.endpoint-card:hover .endpoint-header {
    background: rgba(74, 158, 255, 0.08);
}

.endpoint-card.active .endpoint-header {
    background: var(--accent-gradient);
    color: white;
}

.endpoint-card.active .endpoint-path,
.endpoint-card.active .endpoint-description {
    color: rgba(255, 255, 255, 0.9);
}

.endpoint-card.active .http-method {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Smooth Scrolling for Navigation */
html {
    scroll-padding-top: 100px;
}

/* Print Styles */
@media print {
    .navbar, .hero-section, .stats-section, #try-it, footer {
        display: none !important;
    }

    .main-content {
        padding: 0;
    }

    .endpoint-body {
        display: block !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-gradient: linear-gradient(135deg, var(--primary-color) 0%, #3A8EEF 100%);
        --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    }

    .endpoint-card {
        border: 2px solid #333;
    }
}