
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --light-color: #ecf0f1;
    --dark-color: #1f3d7c;
    --sidebar-width: 280px;
    --header-height: 80px;
    --transition-speed: 0.3s;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --content-padding: 1.5rem;
}

/* Base Styles & Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { 
    font-family: 'Poppins', sans-serif; 
    background-color: #f5f7fa; 
    color: #333; 
    line-height: 1.6; 
    overflow-x: hidden; 
    min-height: 100vh;
}

/* Layout Structure */
.app-container { display: flex; min-height: 100vh; position: relative; }

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(135deg, var(--secondary-color), var(--dark-color));
    color: white;
    height: 100vh;
    position: fixed;
    z-index: 1000;
    transition: transform var(--transition-speed) ease;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}
.sidebar.hidden { transform: translateX(-100%); }
.sidebar-header { padding: 1.5rem; border-bottom: 1px solid rgba(255, 255, 255, 0.1); margin-bottom: 1rem; }
.sidebar-header h3, .sidebar-header a { color: white; font-weight: 600; font-size: 1.2rem; display: flex; align-items: center; text-decoration: none; }
.sidebar-header i { margin-right: 0.75rem; color: var(--primary-color); }
.sidebar-menu { list-style: none; padding: 0 1rem; }
.sidebar-menu li { margin-bottom: 0.25rem; }
.sidebar-menu a { 
    display: flex; align-items: center; padding: 0.75rem 1rem; 
    color: rgba(255, 255, 255, 0.8); text-decoration: none; 
    transition: all var(--transition-speed) ease; border-left: 3px solid transparent; 
    border-radius: var(--border-radius);
}
.sidebar-menu a:hover, .sidebar-menu a.active { background: rgba(255, 255, 255, 0.1); color: white; border-left: 3px solid var(--primary-color); }
.sidebar-menu a i { margin-right: 0.75rem; width: 1.25rem; text-align: center; }

/* Dark Mode Toggle */
.dark-mode-toggle { display: flex; align-items: center; padding: 1rem; color: white; cursor: pointer; }
.switch { position: relative; display: inline-block; width: 50px; height: 24px; margin-right: 10px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #ccc; transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 4px; background: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background: var(--primary-color); }
input:checked + .slider:before { transform: translateX(26px); }

/* Main Content */
.main-content { 
    flex: 1; margin-left: var(--sidebar-width); padding: var(--content-padding); 
    transition: margin-left var(--transition-speed) ease; min-height: 100vh; 
    width: -webkit-fill-available;
}
.main-content.full-width { margin-left: 0; }

/* Menu Toggle */
.menu-toggle {
    display: none;
    position: fixed; top: 1rem; left: 1rem; z-index: 1100;
    background: var(--primary-color); color: white; border: none;
    width: 3rem; height: 3rem; border-radius: 50%; font-size: 1.2rem;
    cursor: pointer; transition: all var(--transition-speed) ease;
    box-shadow: var(--box-shadow); align-items: center; justify-content: center;
}
.menu-toggle:hover { background: #2980b9; transform: scale(1.1); }

/* Header */
.header {
    display: flex; flex-direction: column; gap: 1rem; padding: 1rem 0; margin-bottom: 2rem;
    position: sticky; top: 0; background: white; z-index: 100; box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
}
.header-left { display: flex; align-items: center; }
.header-right { display: flex; flex-direction: column; gap: 1rem; }
.user-profile { display: flex; align-items: center; gap: 0.75rem; }
.user-profile img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.search-box { position: relative; width: 100%; }
.search-box input { 
    width: 100%; padding: 0.75rem 1rem 0.75rem 2.5rem; border: 1px solid #ddd; 
    border-radius: 2rem; font-family: 'Poppins', sans-serif; transition: all var(--transition-speed) ease;
}
.search-box input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2); }
.search-box i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: #999; }

/* Content Sections */
.api-dashboard, .how-to-use, .api-documentation, .api-authentication, .api-key-manager {
    background: white; border-radius: var(--border-radius); box-shadow: var(--box-shadow);
    padding: var(--content-padding); margin-bottom: 2rem;
}
.dashboard-header { 
    display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; 
    padding-bottom: 1rem; border-bottom: 1px solid #eee;
}

/* API Tabs */
.api-tabs { 
    display: flex; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
    margin-bottom: 1.5rem; gap: 0.5rem;
}
.api-tabs::-webkit-scrollbar { display: none; }
.api-tab { 
    padding: 0.75rem 1.25rem; cursor: pointer; font-weight: 500; color: #666;
    border-bottom: 3px solid transparent; transition: all var(--transition-speed) ease;
    white-space: nowrap; position: relative; flex-shrink: 0;
}
.api-tab:hover { color: var(--primary-color); }
.api-tab.active { color: var(--primary-color); border-bottom: 3px solid var(--primary-color); }
.requires-api-key { position: relative; }
.requires-api-key::after { 
    content: "Requires API Key"; position: absolute; top: -0.5rem; right: -0.5rem;
    background: var(--warning-color); color: white; border-radius: 4px;
    padding: 0.2rem 0.5rem; font-size: 0.7rem; font-weight: 500;
}
.badge { 
    position: absolute; top: -5px; right: -5px; background: var(--accent-color); 
    color: white; border-radius: 50%; width: 18px; height: 18px; 
    font-size: 10px; display: flex; align-items: center; justify-content: center;
}

/* API Content */
.api-content { display: none; animation: fadeIn 0.5s ease; }
.api-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* API Endpoint Cards */
.api-endpoint {
    background: #f8f9fa; border-radius: var(--border-radius); padding: var(--content-padding);
    margin-bottom: 1.5rem; border-left: 4px solid var(--primary-color);
    transition: all var(--transition-speed) ease;
}
.api-endpoint:hover { transform: translateY(-3px); box-shadow: var(--box-shadow); }
.endpoint-header { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }
.endpoint-method { 
    padding: 0.25rem 0.5rem; border-radius: 4px; font-weight: 600; font-size: 0.8rem;
    text-transform: uppercase; color: white; width: fit-content;
}
.method-get { background: var(--success-color); }
.method-post { background: var(--info-color); }
.method-put { background: var(--warning-color); }
.method-delete { background: var(--accent-color); }
.endpoint-url { 
    font-family: 'Courier New', Courier, monospace; background: #e9ecef; 
    padding: 0.5rem 0.75rem; border-radius: 4px; font-size: 0.9rem; word-break: break-all;
}
.endpoint-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.endpoint-btn { 
    padding: 0.5rem 1rem; border-radius: 4px; font-size: 0.85rem; font-weight: 500;
    cursor: pointer; transition: all var(--transition-speed) ease; border: none;
    display: flex; align-items: center; gap: 0.5rem;
}
.btn-try { background: var(--primary-color); color: white; }
.btn-try:hover { background: #2980b9; }
.btn-docs { background: #f8f9fa; color: var(--secondary-color); border: 1px solid #ddd; }
.btn-docs:hover { background: #e9ecef; }

/* JSON Viewer & Response */
.json-viewer {
    background: #282c34; color: #abb2bf; border-radius: var(--border-radius); padding: 1rem;
    font-family: 'Courier New', Courier, monospace; font-size: 0.9rem; margin-top: 1rem;
    overflow-x: auto; max-height: 400px; display: none;
}
.response-status { margin-top: 0.75rem; padding: 0.5rem 0.75rem; border-radius: 4px; font-size: 0.85rem; display: inline-block; }
.status-success { background: rgba(46, 204, 113, 0.1); color: #27ae60; border: 1px solid #2ecc71; }
.status-error { background: rgba(231, 76, 60, 0.1); color: #c0392b; border: 1px solid #e74c3c; }

/* API Key Manager */
.api-key-form { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }
.api-key-input { flex: 1; padding: 0.75rem 1rem; border: 1px solid #ddd; border-radius: var(--border-radius); font-family: 'Poppins', sans-serif; }
.api-key-save { background: var(--primary-color); color: white; border: none; padding: 0.75rem 1.5rem; border-radius: var(--border-radius); cursor: pointer; transition: all var(--transition-speed) ease; }
.api-key-save:hover { background: #2980b9; }
.api-key-status { color: var(--success-color); font-size: 0.9rem; display: none; }

/* How-to-use Steps */
.usage-step { display: flex; margin-bottom: 15px; }
.step-number { background: var(--primary-color); color: white; width: 25px; height: 25px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.8rem; margin-right: 15px; flex-shrink: 0; }

/* Code Blocks */
.code-block {
    position: relative; background: #f5f7f9; border-left: 4px solid var(--primary-color);
    padding: 1rem; margin: 1rem 0; font-family: 'Courier New', monospace;
    font-size: 0.9rem; border-radius: 0 var(--border-radius) var(--border-radius) 0;
    overflow-x: auto;
}
.copy-code { background: var(--primary-color); color: white; border: none; padding: 0.5rem 1rem; border-radius: var(--border-radius); cursor: pointer; transition: all var(--transition-speed) ease; font-size: 0.85rem; }
.copy-code:hover { background: #2980b9; }

/* Documentation Sections */
.doc-section { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid #eee; }
.doc-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.doc-section h3 { color: var(--secondary-color); margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.75rem; }
.doc-section h3 i { color: var(--primary-color); }

/* Tables */
.endpoint-table, .params-table { overflow-x: auto; margin-top: 1rem; border-radius: var(--border-radius); border: 1px solid #eee; }
.endpoint-table table, .params-table table { width: 100%; border-collapse: collapse; }
.endpoint-table th, .endpoint-table td, .params-table th, .params-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid #eee; }
.endpoint-table th, .params-table th { background: #f8f9fa; font-weight: 600; color: var(--secondary-color); }

/* FAQ Accordion */
.faq-accordion { border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--box-shadow); }
.faq-item { border-bottom: 1px solid #eee; background: #fff; }
.faq-item:last-child { border-bottom: none; }
.faq-question { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; background: #f8f9fa; border: none; cursor: pointer; text-align: left; transition: all var(--transition-speed) ease; }
.faq-question:hover { background: #f1f5f9; }
.faq-question span { font-weight: 600; color: var(--secondary-color); font-size: 1.05rem; }
.faq-question i { color: #7f8c8d; transition: transform var(--transition-speed) ease; }
.faq-item.active .faq-question { background: #e3f2fd; }
.faq-item.active .faq-question i { transform: rotate(180deg); color: var(--primary-color); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height var(--transition-speed) ease, padding var(--transition-speed) ease; background: white; }
.faq-item.active .faq-answer { max-height: 1000px; padding: 0 1.25rem 1.25rem; }

/* Support Grid & Cards */
.support-grid, .partners-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; margin: 1.5rem 0; }
.support-card, .partner-card { background: white; border-radius: var(--border-radius); box-shadow: var(--box-shadow); overflow: hidden; transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease; }
.support-card:hover, .partner-card:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); }
.support-card-header { background: var(--primary-color); color: white; padding: 1rem 1.25rem; display: flex; align-items: center; gap: 0.75rem; }
.contact-method { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #eee; }
.contact-method:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.contact-method i { color: var(--primary-color); width: 1.25rem; text-align: center; }

/* Forms */
.modern-form { background: white; padding: var(--content-padding); border-radius: var(--border-radius); box-shadow: var(--box-shadow); }
.form-row { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }
.form-group { flex: 1; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: var(--secondary-color); }
.form-input { width: 100%; padding: 0.75rem 1rem; border: 1px solid #ddd; border-radius: var(--border-radius); font-family: 'Poppins', sans-serif; font-size: 0.95rem; transition: all var(--transition-speed) ease; }
.form-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1); }
.phone-input { display: flex; border-radius: var(--border-radius); overflow: hidden; border: 1px solid #ddd; }
.country-selector { display: flex; align-items: center; gap: 0.5rem; background: #f8f9fa; padding: 0 1rem; border-right: 1px solid #ddd; }
.priority-selector { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.priority-option { position: relative; cursor: pointer; }
.priority-badge { display: block; padding: 0.5rem 1rem; border-radius: 2rem; font-size: 0.85rem; font-weight: 500; transition: all var(--transition-speed) ease; }
.priority-badge.low { background: #e8f5e9; color: #2e7d32; }
.priority-badge.medium { background: #fff3e0; color: #ef6c00; }
.priority-badge.high { background: #ffebee; color: #c62828; }
.priority-badge.critical { background: #fce4ec; color: #ad1457; }
input[type="radio"]:checked + .priority-badge { box-shadow: 0 0 0 2px currentColor; }
.submit-btn { background: var(--primary-color); color: white; border: none; padding: 0.75rem 1.5rem; border-radius: var(--border-radius); cursor: pointer; transition: all var(--transition-speed) ease; font-weight: 500; margin-top: 0.5rem; }
.submit-btn:hover { background: #2980b9; }

/* Language Tabs */
.language-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; overflow-x: auto; padding-bottom: 0.5rem; }
.language-tab { padding: 0.5rem 1rem; border-radius: var(--border-radius); background: #f0f4f8; border: none; cursor: pointer; transition: all var(--transition-speed) ease; white-space: nowrap; }
.language-tab.active { background: var(--primary-color); color: white; }
.language-content { display: none; }
.language-content.active { display: block; }
.example-card { background: white; border-radius: var(--border-radius); box-shadow: var(--box-shadow); margin-bottom: 1.5rem; overflow: hidden; }
.example-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; background: #f8f9fa; border-bottom: 1px solid #eee; }

/* Modals */
.endpoint-doc-modal {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5);
    z-index: 2000; display: flex; align-items: center; justify-content: center;
    padding: 1rem; overflow-y: auto;
}
.modal-content {
    background: white; border-radius: var(--border-radius); box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    width: 100%; max-width: 900px; max-height: 90vh; overflow-y: auto;
    animation: modalFadeIn 0.3s ease;
}
@keyframes modalFadeIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.modal-header { padding: 1.25rem; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: white; z-index: 10; }
.close-modal { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #999; transition: all var(--transition-speed) ease; }
.close-modal:hover { color: var(--accent-color); transform: rotate(90deg); }
.modal-body { padding: 1.25rem; }

/* Footer */
.footer { background: var(--secondary-color); color: white; padding: 2rem; text-align: center; margin-top: 2rem; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.25rem; margin-bottom: 1.25rem; }
.footer-links a { color: rgba(255, 255, 255, 0.7); text-decoration: none; transition: all var(--transition-speed) ease; }
.footer-links a:hover { color: white; }

/* Utility Classes */
.text-warning { color: var(--warning-color); }
.text-danger { color: var(--accent-color); }
.text-success { color: var(--success-color); }
.text-info { color: var(--info-color); }
.required { color: var(--accent-color); }
.hidden { display: none !important; }

/* Loading Spinner */
.spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid rgba(255, 255, 255, 0.3); border-radius: 50%; border-top-color: white; animation: spin 1s ease-in-out infinite; margin-right: 5px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* JSON Syntax Highlighting */
.json-key { color: #61afef; }
.json-value { color: #98c379; }
.json-string { color: #98c379; }
.json-number { color: #d19a66; }
.json-boolean { color: #d19a66; }
.json-null { color: #d19a66; }

/* Dark Mode Styles */
body.dark-mode { background-color: #121212; color: #e0e0e0; }
.dark-mode .main-content, .dark-mode .api-dashboard, .dark-mode .how-to-use, 
.dark-mode .api-documentation, .dark-mode .api-authentication, .dark-mode .api-key-manager,
.dark-mode .header, .dark-mode .api-endpoint, .dark-mode .modern-form, 
.dark-mode .support-card, .dark-mode .example-card, .dark-mode .partner-card,
.dark-mode .faq-item, .dark-mode .faq-question, .dark-mode .faq-answer,
.dark-mode .endpoint-doc-modal .modal-content, .dark-mode .endpoint-doc-modal .modal-header {
    background-color: #000007; color: #e0e0e0;
}
.dark-mode .header, .dark-mode .dashboard-header, .dark-mode .doc-section { border-bottom-color: #333; }
.dark-mode .search-box input, .dark-mode .api-key-input, .dark-mode .form-input { background: #333; color: #fff; border-color: #444; }
.dark-mode .sidebar-menu a:hover, .dark-mode .sidebar-menu a.active { background: rgba(255, 255, 255, 0.1); }
.dark-mode .json-viewer, .dark-mode .code-block { background: #252525; border-left-color: #444; }
.dark-mode .endpoint-table, .dark-mode .params-table { border-color: #333; }
.dark-mode .endpoint-table th, .dark-mode .params-table th { background: #2d2d2d; color: #e0e0e0; }
.dark-mode .endpoint-table td, .dark-mode .params-table td { border-bottom-color: #333; color: #e0e0e0; }

/* Responsive Design */
@media (min-width: 768px) {
    .header { flex-direction: row; justify-content: space-between; align-items: center; }
    .header-right { flex-direction: row; align-items: center; }
    .search-box { width: auto; }
    .search-box input { width: 250px; }
    .search-box input:focus { width: 300px; }
    .api-key-form { flex-direction: row; }
    .form-row { flex-direction: row; }
}

@media (max-width: 992px) {
    .menu-toggle { display: flex; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .header { margin-top: 4rem; }
}

@media (max-width: 576px) {
    .header h1 { font-size: 1.5rem; }
    .api-tabs { gap: 0.25rem; }
    .api-tab { padding: 0.5rem 0.75rem; font-size: 0.85rem; }
    .endpoint-actions { flex-direction: column; }
    .endpoint-btn { width: 100%; justify-content: center; }
    .support-grid, .partners-grid { grid-template-columns: 1fr; }
    .footer { padding: 1.5rem; }
}