/**
 * iCount API Documentation Plugin Styles
 */

/* Reset and Base Styles */
.icount-api-docs * {
    box-sizing: border-box;
}

.icount-api-docs {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 20px 0;
}

/* Dark Theme */
.icount-api-docs.theme-dark {
    color: #e0e0e0;
    background: #1a1a1a;
}

.icount-api-docs.theme-dark .api-docs-header {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
}

.icount-api-docs.theme-dark .overview-card,
.icount-api-docs.theme-dark .module-card,
.icount-api-docs.theme-dark .method-card {
    background: #2d3748;
    border-color: #4a5568;
}

.icount-api-docs.theme-dark .search-input,
.icount-api-docs.theme-dark .method-select,
.icount-api-docs.theme-dark .language-select,
.icount-api-docs.theme-dark .param-input {
    background: #2d3748;
    border-color: #4a5568;
    color: #e0e0e0;
}

.icount-api-docs.theme-dark .nav-tab {
    background: #2d3748;
    color: #a0aec0;
    border-color: #4a5568;
}

.icount-api-docs.theme-dark .nav-tab.active {
    background: #4299e1;
    color: white;
}

/* Header */
.api-docs-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.api-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.api-logo {
    font-size: 3rem;
}

.api-subtitle {
    font-size: 1.2rem;
    margin: 0 0 30px 0;
    opacity: 0.9;
}

/* Search */
.search-container {
    display: flex;
    max-width: 400px;
    margin: 0 auto 20px auto;
    position: relative;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 25px 0 0 25px;
    font-size: 16px;
    outline: none;
}

.search-btn {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 0 25px 25px 0;
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Theme Toggle */
.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
}

.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Navigation */
.api-nav {
    background: #f8f9fa;
    padding: 0 20px;
    border-bottom: 1px solid #dee2e6;
}

.nav-tabs {
    display: flex;
    gap: 2px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-tab {
    padding: 15px 25px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 16px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s;
}

.nav-tab:hover {
    color: #495057;
    background: rgba(0, 0, 0, 0.05);
}

.nav-tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: white;
}

/* Content */
.api-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Overview */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.overview-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.overview-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.overview-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.5rem;
    color: #333;
}

.overview-card p {
    margin: 0 0 20px 0;
    color: #666;
}

.quick-start-example h4 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: #333;
}

.inline-code {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    color: #e83e8c;
    border: 1px solid #dee2e6;
}

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

.feature-list li {
    padding: 8px 0;
    font-size: 1.1rem;
}

.api-stats {
    display: flex;
    gap: 30px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #007bff;
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 1rem;
    color: #666;
    margin-top: 5px;
}

/* Modules */
.modules-header {
    text-align: center;
    margin-bottom: 40px;
}

.modules-header h2 {
    font-size: 2.5rem;
    margin: 0 0 15px 0;
    color: #333;
}

.modules-header p {
    font-size: 1.2rem;
    color: #666;
    margin: 0;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.module-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.module-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    color: #007bff;
}

.module-card .module-description {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.module-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.method-tag {
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Playground */
.playground-header {
    text-align: center;
    margin-bottom: 40px;
}

.playground-header h2 {
    font-size: 2.5rem;
    margin: 0 0 15px 0;
    color: #333;
}

.playground-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.playground-left,
.playground-right {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 30px;
}

/* Method Selection */
.method-selector {
    margin-bottom: 30px;
}

.method-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.method-select,
.language-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 16px;
    background: white;
    outline: none;
    transition: border-color 0.3s;
}

.method-select:focus,
.language-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Parameters */
.parameters-section {
    margin-bottom: 30px;
}

.parameters-section h3 {
    margin: 0 0 20px 0;
    color: #333;
}

.parameters-container {
    min-height: 100px;
}

.no-method-selected {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 40px 20px;
}

.param-group {
    margin-bottom: 20px;
}

.param-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.param-required {
    color: #dc3545;
    font-size: 0.8rem;
}

.param-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.param-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.param-description {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 5px;
}

/* Language Selector */
.language-selector {
    margin-bottom: 30px;
}

.language-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

/* Code Sample */
.code-sample-section h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.code-container {
    position: relative;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

.copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s;
}

.copy-code-btn:hover {
    background: #5a6268;
}

.code-container pre {
    margin: 0;
    padding: 20px;
    overflow-x: auto;
    background: transparent;
}

.code-container code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
}

/* Test Button */
.test-section {
    text-align: center;
}

.test-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 150px;
    position: relative;
}

.test-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.test-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-loader {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Response Section */
.response-section h3 {
    margin: 0 0 20px 0;
    color: #333;
}

.response-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
}

.response-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s;
}

.response-tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.response-tab-content {
    display: none;
}

.response-tab-content.active {
    display: block;
}

.no-response {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.no-response p {
    font-size: 1.1rem;
    margin: 0;
}

.response-content pre {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
    overflow-x: auto;
    max-height: 400px;
    margin: 0;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    animation: slideIn 0.3s;
}

.modal-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Error Styles */
.error-response {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
}

.error-response h4 {
    margin: 0 0 10px 0;
    color: #721c24;
}

.theme-dark .error-response {
    background: #2d1b1e;
    color: #f8d7da;
    border-color: #842029;
}

.search-result-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.search-result-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.search-result-item h4 {
    margin: 0 0 8px 0;
    color: #007bff;
}

.search-result-item p {
    margin: 0 0 10px 0;
    color: #666;
}

.result-type {
    background: #e9ecef;
    color: #495057;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.theme-dark .search-result-item {
    background: #2d3748;
    border-color: #4a5568;
}

.theme-dark .search-result-item h4 {
    color: #4299e1;
}

.theme-dark .search-result-item p {
    color: #a0aec0;
}

/* Loading states */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.theme-dark .loading-overlay {
    background: rgba(26, 26, 26, 0.8);
}

/* Responsive Design */
@media (max-width: 768px) {
    .api-title {
        font-size: 2rem;
    }
    
    .playground-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
    }
    
    .modules-grid {
        grid-template-columns: 1fr;
    }
    
    .api-stats {
        justify-content: center;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
    }
    
    .nav-tab {
        flex: 1;
        min-width: 100px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .theme-toggle {
        position: static;
        margin-top: 20px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .api-content {
        padding: 20px 15px;
    }
    
    .playground-left,
    .playground-right {
        padding: 20px;
    }
    
    .overview-card {
        padding: 20px;
    }
}
