/* Custom styles for JetPalate API Documentation */

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --secondary-color: #6b7280;
    --light-bg: #f8fafc;
    --light-paper: #ffffff;
    --light-card: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
}

body {
    font-family: apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.5;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navbar customization */
.navbar {
    background-color: var(--light-paper) !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 1030;
    position: relative;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--text-primary) !important;
}

.navbar-brand i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    transition: color 0.15s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

/* Hero section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border-radius: 14px;
    margin-bottom: 2rem;
    padding: 3rem 2rem;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hero-section h1 {
    font-weight: 600;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Cards */
.card {
    background-color: var(--light-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: var(--light-paper) !important;
    border-radius: 14px 14px 0 0 !important;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.card-body {
    background-color: var(--light-card);
    color: var(--text-primary);
}

/* Method badges */
.method-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.method-get {
    background-color: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

.method-post {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.method-put {
    background-color: #fef3c7;
    color: #d97706;
    border: 1px solid #fcd34d;
}

.method-delete {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

/* API Documentation specific styles */
.docs-header {
    background: var(--light-card);
    padding: 2rem;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.endpoint-card {
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.endpoint-card:hover {
    transform: translateY(-1px);
}

.endpoint-content {
    background: var(--light-card);
}

.endpoint-content .card-body {
    padding: 2rem;
    background: var(--light-card);
    color: var(--text-primary);
}

/* Tables */
.table {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.table th {
    background-color: var(--light-bg);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
}

.table td {
    vertical-align: middle;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Code blocks */
pre {
    background-color: #1f2937;
    color: #f9fafb;
    border-radius: 0.5rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-x: auto;
}

pre code {
    color: inherit;
    background: none;
    padding: 0;
}

/* Response examples */
.response-example {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.response-example pre {
    margin: 0;
    border-radius: 0;
}



/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
    color: white;
}

.btn-outline-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline-secondary:hover {
    background-color: var(--light-bg);
    color: var(--text-primary);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.5rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--primary-color);
}

/* Login form */
.login-form {
    max-width: 400px;
    margin: 0 auto;
}

/* Features section */
.features-section .card {
    border: 1px solid var(--border-color);
    background: var(--light-card);
    color: var(--text-primary);
}

.features-section .card-body {
    padding: 2rem;
    background: var(--light-card);
    color: var(--text-primary);
}

.features-section i {
    color: var(--primary-color);
}

.features-section .card-title {
    color: var(--text-primary);
}

.features-section .card-text {
    color: var(--text-secondary);
}

/* Form styles */
.form-control {
    background-color: var(--light-paper);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
}

.form-control:focus {
    background-color: var(--light-paper);
    border-color: var(--primary-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.form-label {
    color: var(--text-primary);
    font-weight: 500;
}

.form-text {
    color: var(--text-secondary);
}

/* Dropdown styles */
.dropdown-menu {
    background-color: var(--light-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 0.5rem;
}

.dropdown-item {
    color: var(--text-secondary);
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--light-bg);
    color: var(--text-primary);
}

.dropdown-item i {
    margin-right: 0.5rem;
    width: 1rem;
    text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .docs-header {
        padding: 1.5rem;
    }
    
    .endpoint-content .card-body {
        padding: 1.5rem;
    }
    
    .method-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }
}

/* Animation for expanding/collapsing */
.endpoint-content {
    transition: all 0.3s ease-in-out;
}

/* Copy button animation */
.btn-outline-primary:active {
    transform: scale(0.95);
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Footer styles */
footer {
    z-index: 1040;
    background-color: #1f2937 !important;
    border-top: 1px solid var(--border-color);
}

footer a {
    color: var(--primary-color) !important;
    text-decoration: none;
}

footer a:hover {
    color: var(--primary-hover) !important;
    text-decoration: underline !important;
}

/* Z-index management */
.z-index-3 {
    z-index: 3 !important;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

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

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

/* Fix potential conflicts */
.dropdown-menu {
    z-index: 1050 !important;
}

/* Ensure content doesn't overlap footer */
body {
    padding-bottom: 80px;
}

/* Documentation tabs styling */
.nav-pills .nav-link {
    border-radius: 12px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    margin: 0 0.25rem;
}

.nav-pills .nav-link.active {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.nav-pills .nav-link:not(.active) {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.nav-pills .nav-link:not(.active):hover {
    background-color: var(--light-bg);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* Webhook-specific styles */
.webhook-events .event-category {
    margin-bottom: 2rem;
}

.webhook-events .event-item {
    border-left: 4px solid transparent;
    padding-left: 1rem;
    margin-bottom: 2rem;
}

.webhook-events .event-item:hover {
    border-left-color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.02);
    border-radius: 0 8px 8px 0;
    transition: all 0.3s ease;
}

.hierarchy-tree ul {
    margin-left: 1.5rem;
    border-left: 2px solid var(--border-color);
    padding-left: 1rem;
}

.hierarchy-tree li {
    margin: 0.5rem 0;
    position: relative;
}

.hierarchy-tree li::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 0.75rem;
    width: 0.75rem;
    height: 2px;
    background-color: var(--border-color);
}

/* Badge enhancements for webhook events */
.webhook-events .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Tab content animation */
.tab-pane {
    animation: fadeInUp 0.4s ease-in-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments for tabs */
@media (max-width: 768px) {
    .nav-pills .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        margin: 0 0.1rem;
    }
    
    .hierarchy-tree ul {
        margin-left: 1rem;
    }
    
    .webhook-events .event-item {
        padding-left: 0.5rem;
    }
}

/* Webhook Sandbox Specific Styles */
.webhook-sandbox {
    background-color: var(--light-bg);
    min-height: 100vh;
}

.webhook-sandbox .card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.webhook-sandbox .card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.webhook-sandbox .card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0 !important;
    padding: 1.25rem 1.5rem;
}

.webhook-sandbox .table th {
    background-color: #f8fafc;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem 0.75rem;
}

.webhook-sandbox .table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.webhook-sandbox .table tbody tr:hover {
    background-color: #f8fafc;
    transition: background-color 0.2s ease;
}

/* Webhook status badges */
.webhook-status-active {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
}

.webhook-status-inactive {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
}

.webhook-status-failed {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
}

/* Event type badges */
.event-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    margin: 0.125rem;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
}

.event-badge-order {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.event-badge-payment {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.event-badge-delivery {
    background-color: #fef3c7;
    color: #d97706;
    border: 1px solid #fcd34d;
}

/* Test results styling */
.test-results {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
}

.test-results .alert {
    margin-bottom: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
}

.test-results .alert-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

/* Webhook URL styling */
.webhook-url {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background-color: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid #e2e8f0;
}

/* Action buttons */
.webhook-actions .btn-group-sm .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
    margin: 0 0.125rem;
}

.webhook-actions .btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.webhook-actions .btn-outline-secondary:hover {
    background-color: var(--secondary-color);
    color: white;
    transform: translateY(-1px);
}

.webhook-actions .btn-outline-danger:hover {
    background-color: var(--danger-color);
    color: white;
    transform: translateY(-1px);
}

/* Modal enhancements */
.webhook-modal .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.webhook-modal .modal-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0;
    padding: 1.5rem;
}

.webhook-modal .modal-body {
    padding: 2rem;
}

.webhook-modal .form-check {
    margin-bottom: 0.75rem;
}

.webhook-modal .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* History table enhancements */
.history-table .table td {
    font-size: 0.875rem;
    padding: 0.75rem;
}

.history-table .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* JSON viewer styling */
.json-viewer {
    background-color: #1f2937;
    color: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.json-viewer pre {
    margin: 0;
    background: none;
    color: inherit;
    padding: 0;
    border: none;
    border-radius: 0;
}

/* Loading animation */
.webhook-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive webhook sandbox */
@media (max-width: 768px) {
    .webhook-sandbox .card-header {
        padding: 1rem;
    }
    
    .webhook-sandbox .table {
        font-size: 0.8rem;
    }
    
    .webhook-sandbox .table th,
    .webhook-sandbox .table td {
        padding: 0.5rem 0.25rem;
    }
    
    .webhook-actions .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .webhook-modal .modal-body {
        padding: 1.5rem;
    }
    
    .test-results {
        max-height: 200px;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .webhook-sandbox {
        background-color: #0f172a;
        color: #f1f5f9;
    }
    
    .webhook-sandbox .card {
        background-color: #1e293b;
        border-color: #334155;
    }
    
    .webhook-sandbox .table th {
        background-color: #1e293b;
        color: #cbd5e1;
    }
    
    .webhook-sandbox .table td {
        color: #e2e8f0;
        border-color: #334155;
    }
}

/* Mode Switch Styles */
.mode-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mode-switch {
    margin: 0;
    padding: 0;
}

.mode-switch .form-check-input {
    width: 3.5rem;
    height: 1.75rem;
    cursor: pointer;
    background-color: #3b82f6;
    border: 2px solid #3b82f6;
    border-radius: 2rem;
    position: relative;
    transition: all 0.3s ease;
}

.mode-switch .form-check-input:checked {
    background-color: #10b981;
    border-color: #10b981;
}

.mode-switch .form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

.mode-switch .form-check-input:checked:focus {
    box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.25);
}

.mode-switch .form-check-input::before {
    content: '';
    position: absolute;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background-color: white;
    top: 50%;
    left: 0.25rem;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mode-switch .form-check-input:checked::before {
    left: calc(100% - 1.5rem);
}

.mode-badge {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.mode-badge i {
    font-size: 1rem;
}

#currentModeLabel {
    font-size: 1.125rem;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

/* Animation for mode change */
@keyframes modeChange {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.mode-badge.changing {
    animation: modeChange 0.3s ease;
}

/* Responsive mode switch */
@media (max-width: 768px) {
    .mode-selector {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    #currentModeLabel {
        font-size: 1rem;
    }
    
    .mode-badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}
