/* ==========================================================================
   PayEngine API Documentation Styles
   ========================================================================== */

/* ==========================================================================
   Base & Typography
   ========================================================================== */

.gradient-text {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   Code Blocks & Syntax Highlighting
   ========================================================================== */

.code-block {
    border-radius: 8px;
    background: #2d2d2d;
}

pre[class*="language-"] {
    margin: 0;
    border-radius: 8px;
}

/* ==========================================================================
   Navigation & Sidebar
   ========================================================================== */

.sidebar-link {
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    padding-left: 1.5rem;
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, transparent 100%);
    border-left: 3px solid #f59e0b;
}

.nav-toggle.active {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, transparent 100%);
    border-left: 3px solid #f59e0b;
    color: #d97706;
}

.endpoint-badge {
    font-family: 'Courier New', monospace;
}

.nav-arrow.rotate-90 {
    transform: rotate(90deg);
}

.nav-submenu {
    border-left: 2px solid #e5e7eb;
}

.nav-submenu .sidebar-link:hover {
    background: rgba(245, 158, 11, 0.05);
}

.nav-submenu .sidebar-link.active {
    background: rgba(245, 158, 11, 0.1);
    border-left: 2px solid #f59e0b;
    color: #d97706;
}

/* ==========================================================================
   Layout & Anchoring
   ========================================================================== */

/* Fix anchoring with fixed header */
section[id], div[id] {
    scroll-margin-top: 110px;
}

/* ==========================================================================
   Mobile Responsive Styles
   ========================================================================== */

/* Mobile and tablet responsive styles */
@media (max-width: 1023px) {
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden !important;
    }
    
    /* Force content to fit */
    * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Code blocks responsive */
    .code-block {
        font-size: 0.8rem;
        max-width: calc(100vw - 2rem);
        overflow-x: auto;
    }
    
    .code-block pre {
        white-space: pre;
        word-wrap: normal;
        overflow-x: auto;
        max-width: 100%;
    }
    
    /* Tables responsive */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
        max-width: calc(100vw - 2rem);
    }
    
    /* Mobile sidebar adjustments */
    .sidebar-link:hover {
        padding-left: 1rem;
    }
    
    /* Tighter spacing */
    section[id], div[id] {
        scroll-margin-top: 90px;
    }
    
    /* Ensure main content doesn't overflow */
    main {
        min-width: 0;
        width: 100%;
    }
}

/* Very small screens */
@media (max-width: 640px) {
    .code-block {
        font-size: 0.75rem;
    }
    
    /* Reduce padding further */
    .code-block {
        padding: 0.5rem !important;
    }
}

/* ==========================================================================
   Dark Mode Styles
   ========================================================================== */

/* Gradient & Branding */
.dark .gradient-text {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Code Blocks */
.dark .code-block {
    background: #374151;
    border: 1px solid #4b5563;
}

.dark pre {
    background: #374151 !important;
}

.dark pre[class*="language-"] {
    background: #374151 !important;
}

.dark .code-block code {
    color: #e5e7eb !important;
    background: #374151 !important;
}

/* Navigation Active States */
.dark .sidebar-link.active {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border-left-color: #fbbf24;
}

.dark .nav-toggle.active {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border-left: 3px solid #fbbf24;
}

.dark .nav-submenu .sidebar-link.active {
    background: rgba(251, 191, 36, 0.15);
    border-left: 2px solid #fbbf24;
    color: #fbbf24;
}

.dark .nav-submenu {
    border-left: 2px solid #374151;
}

.dark .nav-submenu .sidebar-link:hover {
    background: rgba(251, 191, 36, 0.1);
}

/* Text Colors - Only for content areas, not colored frames */
.dark main h3:not([class*="text-yellow-"]):not([class*="text-blue-"]):not([class*="text-green-"]):not([class*="text-red-"]):not([class*="text-indigo-"]):not([class*="text-purple-"]):not([class*="text-pink-"]) {
    color: #f3f4f6;
}

.dark main .font-semibold:not([class*="text-yellow-"]):not([class*="text-blue-"]):not([class*="text-green-"]):not([class*="text-red-"]):not([class*="text-indigo-"]):not([class*="text-purple-"]):not([class*="text-pink-"]) {
    color: #f3f4f6;
}

/* ==========================================================================
   Code Syntax Highlighting (Prism.js Dark Mode)
   ========================================================================== */

.dark .token.property,
.dark .token.tag,
.dark .token.boolean,
.dark .token.number {
    color: #f87171 !important;
}

.dark .token.selector,
.dark .token.attr-name,
.dark .token.string,
.dark .token.char {
    color: #86efac !important;
}

.dark .token.operator,
.dark .token.entity,
.dark .token.url {
    color: #fbbf24 !important;
}

.dark .token.atrule,
.dark .token.attr-value,
.dark .token.keyword {
    color: #a5b4fc !important;
}

.dark .token.function,
.dark .token.class-name {
    color: #c084fc !important;
}

.dark .token.comment,
.dark .token.prolog,
.dark .token.doctype {
    color: #6b7280 !important;
}

.dark .token.punctuation {
    color: #9ca3af !important;
}