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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.header-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-left {
    text-align: left;
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
}

/* Logout Button */
.logout-btn {
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logout-btn:hover {
    background: rgba(192, 57, 43, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.logout-btn:active {
    transform: translateY(0);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.header i {
    color: #f39c12;
    margin-right: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.2);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    background: none;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #333;
    border: 2px solid #bdc3c7;
}

.btn-outline:hover {
    background: #bdc3c7;
    color: white;
}

/* Status Indicator */
.status-indicator {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    display: none;
}

.status-success {
    background: #d5f4e6;
    color: #27ae60;
    border: 1px solid #27ae60;
    display: block;
}

.status-error {
    background: #fdf2f2;
    color: #e74c3c;
    border: 1px solid #e74c3c;
    display: block;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    padding: 2rem;
    min-height: calc(100vh - 400px);
}

/* Documentation Container */
.docs-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.loading-message {
    padding: 3rem;
    text-align: center;
    color: #7f8c8d;
}

.loading-message i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #3498db;
}

/* Documentation Sections */
.doc-section {
    border-bottom: 1px solid #ecf0f1;
}

.doc-section:last-child {
    border-bottom: none;
}

.section-header {
    padding: 1.5rem;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.section-header:hover {
    background: #e9ecef;
}

.section-header i {
    margin-right: 0.75rem;
    color: #3498db;
}

.section-toggle {
    transition: transform 0.3s ease;
    color: #7f8c8d;
}

.section-header.collapsed .section-toggle {
    transform: rotate(-90deg);
}

.section-content {
    display: none;
    padding: 1.5rem;
    animation: slideDown 0.3s ease;
}

.section-content.expanded {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Endpoint Cards */
.endpoint-grid {
    display: grid;
    gap: 1rem;
}

.endpoint-card {
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.endpoint-header {
    padding: 1rem;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.endpoint-method {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-right: 0.75rem;
}

.method-GET {
    background: #27ae60;
    color: white;
}

.method-POST {
    background: #3498db;
    color: white;
}

.method-PUT {
    background: #f39c12;
    color: white;
}

.method-DELETE {
    background: #e74c3c;
    color: white;
}

.endpoint-path {
    font-family: 'Monaco', 'Menlo', monospace;
    font-weight: 600;
    color: #2c3e50;
}

.endpoint-description {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.endpoint-details {
    display: none;
    padding: 1rem;
    border-top: 1px solid #e1e8ed;
    background: white;
}

.endpoint-details.expanded {
    display: block;
    animation: slideDown 0.3s ease;
}

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

.code-block pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

.code-block code {
    color: #f7fafc;
}

/* JSON Response Examples */
.json-example {
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
}

/* Authentication Info */
.auth-info {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.auth-info strong {
    color: #856404;
}

/* Test Panel */
.test-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.test-panel h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.test-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.test-form .form-group {
    margin-bottom: 0;
}

.test-form input,
.test-form select,
.test-form textarea {
    border: 2px solid #e1e8ed;
    background: white;
    color: #333;
}

.test-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.test-result {
    margin-top: 1rem;
    border-radius: 6px;
    overflow: hidden;
    display: none;
}

.test-result.visible {
    display: block;
    animation: slideDown 0.3s ease;
}

.test-result-header {
    padding: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.test-result-success .test-result-header {
    background: #d5f4e6;
    color: #27ae60;
}

.test-result-error .test-result-header {
    background: #fdf2f2;
    color: #e74c3c;
}

.test-result-body {
    padding: 1rem;
    background: #f8f9fa;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.test-result-body pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 1.5rem 2rem;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.version {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .test-panel {
        position: static;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 0;
        box-shadow: none;
    }

    .header {
        padding: 1.5rem;
    }

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

    .main-content {
        padding: 1rem;
        gap: 1rem;
    }

    .test-actions {
        flex-direction: column;
    }

    .footer {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: #7f8c8d;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

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

/* Login Indicator Styles */
.login-indicator {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
}

.login-info i {
    color: #2ecc71;
    font-size: 1.1rem;
}

.login-actions {
    display: flex;
    gap: 1rem;
}

.btn-link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-link i {
    font-size: 0.8rem;
}