/**
 * Care API Documentation Admin Styles
 * 
 * @package Care_API
 */

/* Main Container */
.care-api-docs {
    max-width: 1200px;
    margin: 20px auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Header */
.care-api-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 30px 40px;
    border-radius: 8px 8px 0 0;
    position: relative;
    overflow: hidden;
}

.care-api-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.care-api-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 300;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.care-api-header p {
    margin: 8px 0 0;
    opacity: 0.9;
    font-size: 16px;
}

.api-version {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Navigation Tabs */
.nav-tab-wrapper {
    margin: 0;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.nav-tab {
    border: none;
    background: transparent;
    color: #666;
    padding: 15px 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-tab:hover {
    background: rgba(103, 126, 234, 0.1);
    color: #667eea;
}

.nav-tab.nav-tab-active {
    background: #667eea;
    color: #fff;
    border-radius: 0;
}

/* Content Area */
.api-docs-content {
    padding: 40px;
}

/* Endpoint Groups */
.endpoint-group {
    margin-bottom: 40px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
}

.endpoint-group-header {
    background: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 1px solid #e1e5e9;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.endpoint-group-header:hover {
    background: #e9ecef;
}

.endpoint-group-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.endpoint-group-description {
    color: #666;
    margin: 5px 0 0;
    font-size: 14px;
}

.endpoint-count {
    background: #667eea;
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.toggle-icon {
    font-size: 16px;
    color: #999;
    transition: transform 0.3s ease;
}

.endpoint-group.expanded .toggle-icon {
    transform: rotate(180deg);
}

/* Endpoint List */
.endpoint-list {
    display: none;
    padding: 0;
    margin: 0;
    list-style: none;
}

.endpoint-group.expanded .endpoint-list {
    display: block;
}

.endpoint-item {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
}

.endpoint-item:last-child {
    border-bottom: none;
}

.endpoint-item:hover {
    background: #f8f9fa;
}

.endpoint-header {
    display: flex;
    align-items: center;
    padding: 20px 30px;
    cursor: pointer;
}

.method-badge {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 15px;
    min-width: 60px;
    text-align: center;
}

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

.endpoint-path {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    flex: 1;
}

.endpoint-title {
    font-weight: 600;
    color: #333;
    margin: 0 0 2px;
}

.endpoint-description {
    color: #666;
    font-size: 13px;
    margin: 0;
}

.auth-required {
    background: #ffeaa7;
    color: #d63031;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 10px;
}

.role-required {
    background: #fd79a8;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 5px;
}

/* Endpoint Details */
.endpoint-details {
    display: none;
    padding: 30px;
    background: #f8f9fa;
    border-top: 1px solid #e1e5e9;
}

.endpoint-item.expanded .endpoint-details {
    display: block;
}

.endpoint-section {
    margin-bottom: 30px;
}

.endpoint-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px;
    display: flex;
    align-items: center;
}

.endpoint-section h4::before {
    content: '';
    width: 4px;
    height: 16px;
    background: #667eea;
    margin-right: 10px;
    border-radius: 2px;
}

/* Parameters Table */
.params-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.params-table th,
.params-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.params-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.params-table td {
    font-size: 14px;
    color: #666;
}

.param-name {
    font-family: 'Monaco', 'Consolas', monospace;
    color: #333;
    font-weight: 500;
}

.param-type {
    background: #e9ecef;
    color: #495057;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-family: 'Monaco', 'Consolas', monospace;
}

.param-required {
    color: #dc3545;
    font-weight: 600;
}

/* Code Examples */
.code-example {
    position: relative;
    background: #2d3748;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
}

.code-example-header {
    background: #1a202c;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.code-language {
    color: #a0aec0;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.copy-button {
    background: #4a5568;
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.copy-button:hover {
    background: #667eea;
}

.code-content {
    padding: 20px;
    color: #e2e8f0;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-x: auto;
}

/* API Tester */
.api-tester {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.tester-header {
    background: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 1px solid #e1e5e9;
}

.tester-content {
    padding: 30px;
}

.tester-form {
    display: grid;
    gap: 20px;
}

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

.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

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

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: 'Monaco', 'Consolas', monospace;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    align-items: end;
}

.test-button {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    justify-self: start;
}

.test-button:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.test-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Response Display */
.response-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e1e5e9;
}

.response-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 15px;
}

.status-success { background: #d4edda; color: #155724; }
.status-error { background: #f8d7da; color: #721c24; }
.status-warning { background: #fff3cd; color: #856404; }

.response-headers,
.response-body {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    margin-bottom: 20px;
}

.response-headers pre,
.response-body pre {
    margin: 0;
    padding: 20px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.4;
    overflow-x: auto;
}

/* Settings Page */
.settings-form {
    max-width: 600px;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.settings-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e1e5e9;
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.settings-section h3 {
    margin: 0 0 20px;
    color: #333;
    font-size: 18px;
}

.checkbox-field {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.checkbox-field input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.checkbox-field label {
    margin: 0;
    font-weight: normal;
}

/* Responsive Design */
@media (max-width: 768px) {
    .care-api-docs {
        margin: 10px;
    }

    .care-api-header,
    .api-docs-content,
    .tester-content {
        padding: 20px;
    }

    .endpoint-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .params-table {
        font-size: 12px;
    }

    .params-table th,
    .params-table td {
        padding: 8px 10px;
    }
}

/* Loading States */
.loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
    z-index: 10;
}

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

/* Success/Error Messages */
.notice {
    padding: 15px;
    margin: 20px 0;
    border-radius: 6px;
    font-size: 14px;
}

.notice-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.notice-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.notice-info {
    background: #cce7ff;
    color: #004085;
    border-left: 4px solid #007bff;
}

/* Syntax Highlighting */
.json-key { color: #0969da; }
.json-string { color: #032f62; }
.json-number { color: #0550ae; }
.json-boolean { color: #cf222e; }
.json-null { color: #656d76; }