/* Documentation Styles */
.docs-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    padding: 4rem 0 3rem;
    position: relative;
    overflow: hidden;
}

.docs-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%);
    pointer-events: none;
}

.docs-hero {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.docs-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.docs-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.docs-search {
    max-width: 500px;
    margin: 0 auto;
}

.search-form {
    position: relative;
}

.search-input-group {
    display: flex;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.search-input-group:focus-within {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.search-input-group input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    color: white;
    font-size: 1rem;
    outline: none;
}

.search-input-group input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-input-group button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 1rem 1.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-input-group button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Documentation Content */
.docs-content {
    padding: 4rem 0;
    background: #f8fafc;
}

.docs-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Sidebar */
.docs-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.docs-nav {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.docs-nav h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

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

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: block;
    color: #4a5568;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    background: #667eea;
    color: white;
    transform: translateX(4px);
}

.nav-sublist {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 1rem;
    display: none;
}

.nav-item.active .nav-sublist {
    display: block;
}

.nav-sublink {
    display: block;
    color: #718096;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-sublink:hover,
.nav-sublink.active {
    background: #f0f4ff;
    color: #667eea;
    transform: translateX(4px);
}

.nav-sublink::before {
    content: '•';
    position: absolute;
    left: 0.5rem;
    color: #cbd5e0;
}

/* Main Content */
.docs-main {
    background: white;
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.docs-section {
    margin-bottom: 3rem;
}

.docs-section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.docs-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a202c;
    margin: 2rem 0 1rem 0;
}

.docs-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a202c;
    margin: 1.5rem 0 0.75rem 0;
}

.docs-section p {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.docs-section ul,
.docs-section ol {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.docs-section li {
    margin-bottom: 0.5rem;
}

/* Documentation Cards */
.docs-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    margin: 1.5rem 0;
    transition: all 0.3s ease;
}

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

.docs-card h3 {
    color: #1a202c;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.docs-card h4 {
    color: #1a202c;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

/* Code Blocks */
.code-block {
    background: #1a202c !important;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    overflow-x: auto;
    border: 1px solid #2d3748;
    color: #e2e8f0 !important;
}

.code-block pre {
    margin: 0;
    color: #e2e8f0 !important;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    background: transparent !important;
}

.code-block code {
    color: #e2e8f0 !important;
    font-family: 'Courier New', monospace;
    background: transparent !important;
}

.code-block pre code {
    color: #e2e8f0 !important;
    background: transparent !important;
}

/* Tip Box */
.tip-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #0ea5e9;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-left: 4px solid #0ea5e9;
}

.tip-box strong {
    color: #0c4a6e;
    font-weight: 600;
}

/* Rate Limit Example */
.rate-limit-example {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.rate-limit-example h5 {
    color: #1a202c;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.rate-limit-example ul {
    margin: 0;
    padding-left: 1.5rem;
}

.rate-limit-example li {
    margin-bottom: 0.5rem;
    color: #4a5568;
    line-height: 1.6;
}

.rate-limit-example code {
    background: #1a202c;
    color: #e2e8f0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Inline Code */
code {
    background: #f1f5f9 !important;
    color: #e11d48 !important;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Override for code blocks */
.code-block code {
    background: transparent !important;
    color: #e2e8f0 !important;
    padding: 0;
}

/* Force code block visibility */
.code-block,
.code-block * {
    color: #e2e8f0 !important;
    background: #1a202c !important;
}

.code-block pre,
.code-block pre * {
    color: #e2e8f0 !important;
    background: transparent !important;
}

/* Ensure code blocks are not white */
pre {
    background: #1a202c !important;
    color: #e2e8f0 !important;
}

pre code {
    background: transparent !important;
    color: #e2e8f0 !important;
}

/* Ultimate code block visibility fix */
.docs-content .code-block,
.docs-content .code-block pre,
.docs-content .code-block code,
.docs-content pre,
.docs-content code {
    background: #1a202c !important;
    color: #e2e8f0 !important;
    border: 1px solid #2d3748 !important;
}

.docs-content .code-block pre,
.docs-content .code-block code {
    background: transparent !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .docs-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .docs-sidebar {
        position: static;
        order: -1;
    }
    
    .docs-main {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .docs-header {
        padding: 3rem 0 2rem;
    }
    
    .docs-hero h1 {
        font-size: 2.5rem;
    }
    
    .docs-subtitle {
        font-size: 1rem;
    }
    
    .docs-content {
        padding: 3rem 0;
    }
    
    .docs-main {
        padding: 1.5rem;
    }
    
    .docs-card {
        padding: 1.5rem;
    }
    
    .search-input-group {
        flex-direction: column;
        border-radius: 12px;
    }
    
    .search-input-group input {
        border-radius: 12px 12px 0 0;
    }
    
    .search-input-group button {
        border-radius: 0 0 12px 12px;
    }
}

@media (max-width: 480px) {
    .docs-hero h1 {
        font-size: 2rem;
    }
    
    .docs-main {
        padding: 1rem;
    }
    
    .docs-card {
        padding: 1rem;
    }
    
    .code-block {
        padding: 1rem;
        font-size: 0.8rem;
    }
}

/* API Testing Styles */
.api-test-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.api-test-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.api-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.api-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.api-test-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.api-test-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.api-test-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.api-test-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    display: none;
}

.api-test-result.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    display: block;
}

.api-test-result.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    display: block;
}

.api-test-result.info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    display: block;
}

/* Endpoint Styles */
.endpoint-category {
    margin-bottom: 2rem;
}

.endpoint-category h4 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.endpoint-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.endpoint-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.endpoint-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.method {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.method.get {
    background: #dcfce7;
    color: #166534;
}

.method.post {
    background: #dbeafe;
    color: #1e40af;
}

.method.put {
    background: #fef3c7;
    color: #92400e;
}

.method.delete {
    background: #fecaca;
    color: #dc2626;
}

.endpoint-header code {
    background: #1a202c;
    color: #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    flex: 1;
}

.test-endpoint-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.test-endpoint-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.test-endpoint-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.endpoint-params {
    margin: 1rem 0;
}

.endpoint-params ul {
    margin: 0.5rem 0 0 1rem;
    padding: 0;
}

.endpoint-params li {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.endpoint-example {
    margin-top: 1rem;
}

/* Webhook Events */
.webhook-events {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.webhook-event {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
}

.webhook-event strong {
    color: #1a202c;
    font-size: 0.9rem;
}

.webhook-event p {
    color: #4a5568;
    font-size: 0.8rem;
    margin: 0.25rem 0 0 0;
}

/* Status Codes */
.status-codes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    margin: 1rem 0;
}

.status-code {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.9rem;
}

.status-code code {
    background: #1a202c;
    color: #e2e8f0;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

/* API Testing Modal */
.api-test-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.api-test-modal.show {
    display: flex;
}

.api-test-modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.api-test-modal h3 {
    margin-top: 0;
    color: #1a202c;
}

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

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

.api-test-form-modal label {
    font-weight: 600;
    color: #374151;
}

.api-test-form-modal input,
.api-test-form-modal textarea,
.api-test-form-modal select {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

.api-test-form-modal textarea {
    min-height: 100px;
    font-family: 'Courier New', monospace;
}

.api-test-modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.api-test-modal-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.api-test-modal-btn.primary {
    background: #667eea;
    color: white;
}

.api-test-modal-btn.primary:hover {
    background: #5a67d8;
}

.api-test-modal-btn.secondary {
    background: #e5e7eb;
    color: #374151;
}

.api-test-modal-btn.secondary:hover {
    background: #d1d5db;
}

/* Responsive API Testing */
@media (max-width: 768px) {
    .api-test-form {
        flex-direction: column;
    }
    
    .endpoint-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .endpoint-header code {
        width: 100%;
    }
    
    .webhook-events {
        grid-template-columns: 1fr;
    }
    
    .status-codes {
        grid-template-columns: 1fr;
    }
    
    .api-test-modal-content {
        width: 95%;
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    .docs-header,
    .docs-sidebar {
        display: none;
    }
    
    .docs-layout {
        grid-template-columns: 1fr;
    }
    
    .docs-card {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .api-test-section,
    .test-endpoint-btn,
    .api-test-modal {
        display: none;
    }
}
