/*
 * IntegrateScript.com - Custom Styles
 * Modern Blue/Purple Theme with Dark Mode Support
 */

/* ============================================
 * CSS Variables (Theme Colors)
 * ============================================ */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --purple-color: #9333ea;
    --cyan-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-purple: linear-gradient(135deg, #9333ea 0%, #c026d3 100%);
    
    --transition-speed: 0.3s;
    --border-radius: 0.75rem;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Dark Mode Variables */
[data-bs-theme="dark"] {
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --border-color: #374151;
    --light-color: #1f2937;
    --dark-color: #111827;
}

/* ============================================
 * Global Styles
 * ============================================ */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    scroll-padding-top: 100px; /* Account for sticky header */
}

html {
    scroll-behavior: smooth;
}

/* Fix for sticky header covering content when scrolling to anchors */
section[id] {
    scroll-margin-top: 100px;
}

/* Brand Styles */
.navbar-brand {
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

/* ============================================
 * Coming Soon Card Styles
 * ============================================ */
.coming-soon-card {
    position: relative;
    overflow: visible;
}

.coming-soon-overlay {
    background: transparent !important;
    backdrop-filter: none;
}

.coming-soon-badge {
    position: relative;
    z-index: 20;
    white-space: nowrap;
    transition: transform 0.2s ease;
}

.coming-soon-badge:hover {
    transform: scale(1.05);
}

.coming-soon-card .card-body,
.coming-soon-card .card-footer {
    position: relative;
    z-index: 1;
}

/* Blur the card content when coming soon */
.coming-soon-card .card-body,
.coming-soon-card .card-footer {
    filter: blur(3px);
    transition: filter 0.3s ease;
}

/* Keep the badge sharp and clear */
.coming-soon-overlay,
.coming-soon-badge {
    filter: none !important;
}

.coming-soon-card:hover {
    transform: none !important;
    box-shadow: var(--box-shadow) !important;
}

/* Ensure badge appears above blurred content */
.coming-soon-badge {
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
}

/* Custom Syntax Highlighting Colors */
pre[class*="language-"] {
    background: #1e1e2e !important;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

code[class*="language-"] {
    background: #1e1e2e !important;
    color: #ffffff !important;
}

/* Keywords (import, from, def, return, etc.) */
.token.keyword,
.token.boolean,
.token.constant,
.token.declaration {
    color: #89b4fa !important; /* Light blue */
    font-weight: 500;
}

/* Function names */
.token.function,
.token.function-name {
    color: #f9e2af !important; /* Yellow/orange */
    font-weight: 500;
}

/* Method calls and built-in functions */
.token.builtin,
.token.method,
.token.function-call {
    color: #fab387 !important; /* Orange */
    font-weight: 500;
}

/* Strings */
.token.string,
.token.string-property {
    color: #f9e2af !important; /* Yellow/orange */
}

/* Comments */
.token.comment,
.token.comment-doc {
    color: #a6e3a1 !important; /* Light green */
    font-style: italic;
}

/* Variables and identifiers */
.token.variable,
.token.parameter,
.token.identifier {
    color: #89b4fa !important; /* Light blue */
    font-weight: 500;
}

/* Numbers */
.token.number {
    color: #cba6f7 !important; /* Light purple */
}

/* Operators and punctuation */
.token.operator,
.token.punctuation {
    color: #f5c2e7 !important; /* Pink */
}

/* Property names and attributes */
.token.property,
.token.attr-name {
    color: #94e2d5 !important; /* Teal */
    font-weight: 500;
}

/* Attribute values */
.token.attr-value {
    color: #a6e3a1 !important; /* Light green */
}

/* Regular expressions */
.token.regex {
    color: #f9e2af !important; /* Yellow/orange */
}

/* Template literals */
.token.template-string {
    color: #f9e2af !important; /* Yellow/orange */
}

/* Boolean values */
.token.boolean {
    color: #cba6f7 !important; /* Light purple */
}

/* Null/undefined */
.token.null,
.token.undefined {
    color: #f38ba8 !important; /* Red */
}

/* Constants */
.token.constant {
    color: #fab387 !important; /* Orange */
}

/* Namespace */
.token.namespace {
    color: #89b4fa !important; /* Light blue */
}

/* Type annotations */
.token.type {
    color: #94e2d5 !important; /* Teal */
}

/* Decorators */
.token.decorator {
    color: #f5c2e7 !important; /* Pink */
}

/* Generics */
.token.generic {
    color: #cba6f7 !important; /* Light purple */
}

/* Class names */
.token.class-name {
    color: #a6e3a1 !important; /* Light green */
    font-weight: 500;
}

/* Properties */
.token.property {
    color: #89b4fa !important; /* Light blue */
}

/* Attributes */
.token.attr-name {
    color: #f9e2af !important; /* Yellow/orange */
}

/* Attribute values */
.token.attr-value {
    color: #a6e3a1 !important; /* Light green */
}

/* Built-in functions */
.token.builtin {
    color: #89b4fa !important; /* Light blue */
}

/* Code block styling */
.code-header {
    background: #313244;
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
}

.code-header .copy-btn {
    background: #45475a;
    color: #ffffff;
    border: 1px solid #585b70;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.code-header .copy-btn:hover {
    background: #585b70;
    transform: translateY(-1px);
}

/* Line highlighting for selected code */
.token.line-highlight {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 2px;
}

/* Success messages and checkmarks */
.token.success,
.token.checkmark {
    color: #a6e3a1 !important; /* Light green */
}

/* Command prompts */
.token.prompt {
    color: #a6e3a1 !important; /* Light green */
}

/* Additional specific token targeting for better multicolor display */
.token.tag {
    color: #f38ba8 !important; /* Red */
}

.token.selector {
    color: #94e2d5 !important; /* Teal */
}

.token.important {
    color: #f38ba8 !important; /* Red */
    font-weight: bold;
}

.token.url {
    color: #89b4fa !important; /* Light blue */
}

.token.inserted {
    color: #a6e3a1 !important; /* Light green */
}

.token.deleted {
    color: #f38ba8 !important; /* Red */
}

.token.changed {
    color: #fab387 !important; /* Orange */
}

/* Python specific tokens */
.token.python .token.function {
    color: #f9e2af !important; /* Yellow/orange */
}

.token.python .token.builtin {
    color: #fab387 !important; /* Orange */
}

.token.python .token.variable {
    color: #89b4fa !important; /* Light blue */
}

/* JavaScript specific tokens */
.token.javascript .token.function {
    color: #f9e2af !important; /* Yellow/orange */
}

.token.javascript .token.method {
    color: #fab387 !important; /* Orange */
}

/* PHP specific tokens */
.token.php .token.function {
    color: #f9e2af !important; /* Yellow/orange */
}

.token.php .token.variable {
    color: #89b4fa !important; /* Light blue */
}

/* Force color for any remaining white elements */
.token:not(.keyword):not(.string):not(.comment):not(.number):not(.function):not(.variable):not(.operator):not(.punctuation) {
    color: #94e2d5 !important; /* Teal fallback */
}

/* Specific targeting for common white elements */
code[class*="language-"] .token:not([class*="keyword"]):not([class*="string"]):not([class*="comment"]):not([class*="number"]):not([class*="function"]):not([class*="variable"]) {
    color: #89b4fa !important; /* Light blue fallback */
}

a {
    transition: all var(--transition-speed);
    cursor: pointer;
}

a.btn {
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

/* ============================================
 * Navbar Styles
 * ============================================ */
.bg-gradient-primary {
    background: var(--gradient-primary) !important;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.navbar-dark .nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all var(--transition-speed);
}

.navbar-dark .nav-link:hover,
.navbar-dark .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* ============================================
 * Hero Section
 * ============================================ */
.hero-section {
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
}

.hero-section > .container {
    position: relative;
    z-index: 1;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
    pointer-events: none;
}

.code-preview-card {
    background: #1e293b !important;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.code-preview-card .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

/* ============================================
 * Category Cards
 * ============================================ */
.category-card {
    transition: all var(--transition-speed);
    border-radius: var(--border-radius);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.category-icon {
    font-size: 2.5rem;
}

/* ============================================
 * Script Cards
 * ============================================ */
.script-card {
    transition: all var(--transition-speed);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.script-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.hover-lift {
    transition: all var(--transition-speed);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* ============================================
 * Badges & Labels
 * ============================================ */
.badge {
    padding: 0.4rem 0.75rem;
    font-weight: 600;
    border-radius: 0.5rem;
    font-size: 0.75rem;
}

.bg-primary-subtle {
    background-color: rgba(102, 126, 234, 0.1) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-purple {
    color: var(--purple-color) !important;
}

/* ============================================
 * Buttons
 * ============================================ */
.btn {
    font-weight: 600;
    border-radius: 0.5rem;
    padding: 0.625rem 1.25rem;
    transition: all var(--transition-speed);
    position: relative;
    z-index: 10;
    pointer-events: auto;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

.btn-floating {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: var(--box-shadow-lg);
}

/* ============================================
 * Feature Icons
 * ============================================ */
.feature-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============================================
 * Stats Grid
 * ============================================ */
.stat-box {
    transition: all var(--transition-speed);
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

/* ============================================
 * Gradients
 * ============================================ */
.bg-gradient-secondary {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

[data-bs-theme="dark"] .bg-gradient-secondary {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

/* ============================================
 * Code Blocks
 * ============================================ */
pre {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.25rem;
    overflow-x: auto;
}

pre code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ============================================
 * Forms
 * ============================================ */
.form-control, .form-select {
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    padding: 0.625rem 1rem;
    transition: all var(--transition-speed);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ============================================
 * Dark Mode Toggle
 * ============================================ */
#darkModeToggle {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
 * Footer
 * ============================================ */
footer a:hover {
    color: var(--primary-color) !important;
}

/* ============================================
 * Pagination
 * ============================================ */
.pagination .page-link {
    border-radius: 0.5rem;
    margin: 0 0.25rem;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
}

.pagination .page-link:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.pagination .page-item.active .page-link {
    background: var(--gradient-primary);
    border-color: transparent;
}

/* ============================================
 * Breadcrumb
 * ============================================ */
.breadcrumb {
    background: transparent;
    padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.25rem;
}

/* ============================================
 * Tables
 * ============================================ */
.table {
    --bs-table-hover-bg: rgba(102, 126, 234, 0.05);
}

/* ============================================
 * Cards
 * ============================================ */
.card {
    border-radius: var(--border-radius);
}

/* ============================================
 * Dark Mode Specific
 * ============================================ */
[data-bs-theme="dark"] body {
    background-color: #0f172a;
}

[data-bs-theme="dark"] .card {
    background-color: #1e293b;
    border-color: #374151;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #1e293b;
    border-color: #374151;
    color: #f9fafb;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #1e293b;
    color: #f9fafb;
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: #1e293b;
    --bs-table-border-color: #374151;
    color: #f9fafb;
}

[data-bs-theme="dark"] .text-dark {
    color: #f9fafb !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #1e293b !important;
}

[data-bs-theme="dark"] .border {
    border-color: #374151 !important;
}

/* ============================================
 * Responsive
 * ============================================ */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0 !important;
    }
    
    .code-preview-card {
        display: none;
    }
    
    .stat-box {
        margin-bottom: 1rem;
    }
}

/* ============================================
 * Animations
 * ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ============================================
 * Scrollbar
 * ============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: #1e293b;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #475569;
}

/* Footer link hover effects */
.hover-primary:hover {
    color: var(--primary-color) !important;
    transition: color 0.3s ease;
}

/* Footer styling */
footer {
    background-color: rgb(255 255 255 / 1) !important;
    color: rgb(75 85 99 / 1) !important;
}

