/**
 * CalcTechLab Main Stylesheet
 * Clean, Professional Design with Dark/Light Mode Support
 * Version 3.0 - Complete Rewrite
 */

/* ============================================
   CSS Variables - Light Theme (Default)
   ============================================ */
:root {
    /* Brand Colors */
    --brand-primary: #06b6d4;
    --brand-secondary: #0891b2;
    --brand-accent: #f59e0b;
    
    /* Primary Colors */
    --primary-50: #ecfeff;
    --primary-100: #cffafe;
    --primary-200: #a5f3fc;
    --primary-300: #67e8f9;
    --primary-400: #22d3ee;
    --primary-500: #06b6d4;
    --primary-600: #0891b2;
    --primary-700: #0e7490;
    --primary-800: #155e75;
    --primary-900: #164e63;
    
    /* Neutral Colors - Light Mode */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Semantic Colors */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-inverse: #ffffff;
    
    --bg-body: #f8fafc;
    --bg-primary: #ffffff;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;
    --border-focus: #06b6d4;
    
    /* Status Colors */
    --success: #10b981;
    --success-bg: #d1fae5;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --info: #3b82f6;
    --info-bg: #dbeafe;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Navbar */
    --navbar-bg: rgba(255, 255, 255, 0.98);
    --navbar-border: #e2e8f0;
}

/* ============================================
   Dark Mode Variables
   ============================================ */
[data-bs-theme="dark"] {
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --text-inverse: #0f172a;
    
    --bg-body: #0f172a;
    --bg-primary: #1e293b;
    --bg-secondary: #334155;
    --bg-tertiary: #475569;
    --bg-card: #1e293b;
    --bg-input: #334155;
    
    --border-color: #334155;
    --border-light: #475569;
    --border-dark: #1e293b;
    
    --success-bg: rgba(16, 185, 129, 0.2);
    --warning-bg: rgba(245, 158, 11, 0.2);
    --danger-bg: rgba(239, 68, 68, 0.2);
    --info-bg: rgba(59, 130, 246, 0.2);
    
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);
    
    --navbar-bg: rgba(30, 41, 59, 0.98);
    --navbar-border: #334155;
}

/* ============================================
   Base Styles
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

main {
    flex: 1;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    color: var(--text-secondary);
    margin-top: 0;
    margin-bottom: 1rem;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--brand-secondary);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    line-height: 1.5;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.3);
}

.btn-primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--brand-secondary);
    border-color: var(--brand-secondary);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-dark);
    color: var(--text-primary);
}

.btn-outline-primary {
    background-color: transparent;
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.btn-outline-primary:hover {
    background-color: var(--brand-primary);
    color: white;
}

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

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

.btn-outline-light {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
    color: white;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
}

.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: var(--radius-full);
}

/* ============================================
   Forms
   ============================================ */
.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    appearance: none;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-text {
    margin-top: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0;
    margin-right: 0.5rem;
    background-color: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

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

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Input Groups */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    border-right: none;
}

.input-group .form-control:focus {
    z-index: 1;
}

.input-group .btn {
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.card-text {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Tool Cards */
.tool-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-base);
    position: relative;
}

.tool-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    color: inherit;
}

.tool-card-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background-color: var(--primary-100);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--brand-primary);
    transition: all var(--transition-base);
}

[data-bs-theme="dark"] .tool-card-icon {
    background-color: rgba(6, 182, 212, 0.15);
}

.tool-card:hover .tool-card-icon {
    background-color: var(--brand-primary);
    color: white;
    transform: scale(1.1);
}

.tool-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.tool-card-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-grow: 1;
    margin-bottom: 0;
}

.tool-card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: var(--radius-full);
}

.tool-card-badge.popular {
    background-color: var(--danger-bg);
    color: var(--danger);
}

.tool-card-badge.new {
    background-color: var(--success-bg);
    color: var(--success);
}

.tool-card-badge.featured {
    background-color: var(--warning-bg);
    color: var(--warning);
}

/* ============================================
   Navbar
   ============================================ */
#mainNavbar {
    background-color: var(--navbar-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--navbar-border);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1030;
    transition: all var(--transition-base);
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.navbar-brand:hover {
    color: var(--text-primary);
}

.navbar-brand img {
    height: 40px;
    width: auto;
    margin-right: 0.5rem;
    border-radius: var(--radius-md);
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 800;
}

.brand-calc { color: var(--brand-primary); }
.brand-tech { color: var(--brand-secondary); }
.brand-lab { color: var(--gray-700); }

[data-bs-theme="dark"] .brand-lab {
    color: var(--gray-300);
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0.875rem !important;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--brand-primary);
    background-color: var(--bg-secondary);
}

.nav-link.active {
    color: var(--brand-primary);
    background-color: var(--primary-50);
}

[data-bs-theme="dark"] .nav-link.active {
    background-color: rgba(6, 182, 212, 0.15);
}

.dropdown-menu {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    min-width: 200px;
}

.dropdown-item {
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background-color: var(--bg-secondary);
    color: var(--brand-primary);
}

.dropdown-header {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 1rem;
}

.dropdown-divider {
    border-color: var(--border-color);
    margin: 0.375rem 0;
}

/* Search */
.nav-search-container {
    position: relative;
    min-width: 260px;
}

.search-input {
    border-radius: var(--radius-full) 0 0 var(--radius-full) !important;
    padding-left: 1rem;
    height: 38px;
    font-size: 0.875rem;
}

.nav-search-container .btn {
    border-radius: 0 var(--radius-full) var(--radius-full) 0 !important;
    height: 38px;
    padding: 0 1rem;
    font-size: 0.875rem;
    min-width: auto;
}

.nav-search-container .btn i {
    font-size: 0.875rem;
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 1050;
    display: none;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

.search-results-dropdown.show {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-fast);
}

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

.search-result-item:hover {
    background-color: var(--bg-secondary);
}

.search-result-icon {
    width: 40px;
    height: 40px;
    background-color: var(--primary-100);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    margin-right: 0.75rem;
    flex-shrink: 0;
}

[data-bs-theme="dark"] .search-result-icon {
    background-color: rgba(6, 182, 212, 0.15);
}

.search-result-name {
    font-weight: 600;
    color: var(--text-primary);
}

.search-result-category {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.search-no-results {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* Theme Toggle */
.theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

/* Mobile Navbar */
.navbar-toggler {
    border: 2px solid var(--border-color);
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-md);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

[data-bs-theme="dark"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%2394a3b8' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

@media (max-width: 991.98px) {
    .nav-search-container {
        width: 100%;
        min-width: auto;
        margin: 1rem 0;
    }
    
    .navbar-collapse {
        padding: 1rem 0;
    }
}

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    padding: 4rem 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.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");
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: white;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    color: white;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
}

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

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-search {
    max-width: 500px;
    margin: 2rem auto 0;
}

.hero-search .input-group {
    background-color: white;
    border-radius: var(--radius-full);
    padding: 0.25rem;
    box-shadow: var(--shadow-lg);
}

.hero-search .form-control {
    border: none;
    background: transparent;
    padding: 0.75rem 1.25rem;
}

.hero-search .form-control:focus {
    box-shadow: none;
}

.hero-search .btn {
    border-radius: var(--radius-full);
}

@media (max-width: 767.98px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* ============================================
   Sections
   ============================================ */
.section {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.bg-light {
    background-color: var(--bg-secondary) !important;
}

/* Category Cards */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-base);
}

.category-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: var(--text-primary);
}

.category-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.category-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.category-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Coming Soon Banner */
.coming-soon-banner {
    background-color: var(--primary-50);
    border: 1px solid var(--primary-200);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    text-align: center;
}

[data-bs-theme="dark"] .coming-soon-banner {
    background-color: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.3);
}

.coming-soon-content {
    color: var(--brand-secondary);
    font-weight: 500;
}

[data-bs-theme="dark"] .coming-soon-content {
    color: var(--primary-300);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 4rem 0 2rem;
    margin-top: auto;
}

.footer-brand {
    margin-bottom: 1.5rem;
}

.footer-brand .brand-text {
    font-size: 1.25rem;
}

.footer-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    max-width: 300px;
}

.footer-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
}

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

.footer-links li {
    margin-bottom: 0.625rem;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: color var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a i {
    font-size: 0.6rem;
    opacity: 0;
    transform: translateX(-5px);
    transition: all var(--transition-fast);
}

.footer-links a:hover {
    color: var(--brand-primary);
}

.footer-links a:hover i {
    opacity: 1;
    transform: translateX(0);
}

.footer-social {
    display: flex;
    gap: 0.625rem;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.footer-social a:hover {
    background-color: var(--brand-primary);
    color: white;
    transform: translateY(-2px);
}

.footer-newsletter-form .input-group {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-full);
    padding: 0.25rem;
    border: 1px solid var(--border-color);
}

.footer-newsletter-form .form-control {
    border: none;
    background: transparent;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.footer-newsletter-form .form-control:focus {
    box-shadow: none;
}

.footer-newsletter-form .btn {
    border-radius: var(--radius-full);
    padding: 0.5rem 1rem;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    margin-top: 3rem;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.footer-made-with {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: var(--success-bg);
    border-color: var(--success);
    color: var(--success);
}

.alert-warning {
    background-color: var(--warning-bg);
    border-color: var(--warning);
    color: var(--warning);
}

.alert-danger {
    background-color: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

.alert-info {
    background-color: var(--info-bg);
    border-color: var(--info);
    color: var(--info);
}

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

.breadcrumb-item a {
    color: var(--text-muted);
}

.breadcrumb-item a:hover {
    color: var(--brand-primary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-light);
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    gap: 0.375rem;
}

.page-link {
    padding: 0.5rem 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    background-color: var(--bg-card);
    transition: all var(--transition-fast);
}

.page-link:hover {
    background-color: var(--bg-secondary);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.page-item.active .page-link {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}

.page-item.disabled .page-link {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-light);
}

/* ============================================
   Calculator Page Styles
   ============================================ */
.calculator-page-wrapper {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
    background-color: var(--bg-body);
}

.calculator-main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.calculator-page-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    border-radius: var(--radius-xl);
    color: white;
}

.calculator-page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.calculator-page-header p {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 0;
    color: white;
}

.calculator-content-area {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.calculator-breadcrumb {
    padding: 1rem 0;
    margin-bottom: 1rem;
}

/* Fullscreen Mode */
.calculator-content-area.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    border-radius: 0;
    overflow: auto;
}

.fullscreen-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    background-color: var(--brand-primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.fullscreen-toggle-btn:hover {
    background-color: var(--brand-secondary);
    transform: scale(1.1);
}

.fullscreen-active #mainNavbar,
.fullscreen-active footer,
.fullscreen-active .calculator-breadcrumb,
.fullscreen-active .calculator-page-header,
.fullscreen-active .calculator-ad-top,
.fullscreen-active .calculator-ad-bottom {
    display: none !important;
}

.fullscreen-active .calculator-page-wrapper {
    padding: 0;
}

.fullscreen-active .calculator-content-area {
    border-radius: 0;
    border: none;
    box-shadow: none;
}

/* ============================================
   Blog Styles
   ============================================ */
.blog-hero {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    padding: 4rem 0;
    color: white;
    margin-bottom: 3rem;
}

.blog-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

.blog-hero p {
    font-size: 1.2rem;
    opacity: 0.95;
    color: white;
}

.blog-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-base);
}

.blog-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.blog-card .card-image {
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
}

.blog-card .card-image a {
    display: block;
    height: 100%;
}

.blog-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.blog-card:hover .card-image img {
    transform: scale(1.05);
}

.blog-card .card-image .placeholder-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: white;
    font-size: 3rem;
    opacity: 0.5;
}

.blog-card .card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card .category-badge {
    display: inline-block;
    width: fit-content;
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-50);
    color: var(--brand-primary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-decoration: none;
    transition: all var(--transition-fast);
}

[data-bs-theme="dark"] .blog-card .category-badge {
    background-color: rgba(6, 182, 212, 0.15);
}

.blog-card .category-badge:hover {
    background-color: var(--brand-primary);
    color: white;
}

.blog-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.blog-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.blog-card h3 a:hover {
    color: var(--brand-primary);
}

.blog-card .excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.blog-card .card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Sidebar Widgets */
.sidebar-widget {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sidebar-widget h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--brand-primary);
    color: var(--text-primary);
}

/* ============================================
   Contact Form
   ============================================ */
.contact-form {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
}

.contact-info-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    height: 100%;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.contact-info-item:last-child {
    margin-bottom: 0;
}

.contact-info-icon {
    width: 48px;
    height: 48px;
    background-color: var(--primary-50);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    font-size: 1.25rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

[data-bs-theme="dark"] .contact-info-icon {
    background-color: rgba(6, 182, 212, 0.15);
}

.contact-info-content h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.contact-info-content p {
    margin-bottom: 0;
    color: var(--text-muted);
}

/* ============================================
   Utilities
   ============================================ */
.text-primary { color: var(--brand-primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }

.bg-primary { background-color: var(--brand-primary) !important; }
.bg-secondary { background-color: var(--bg-secondary) !important; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 991.98px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 767.98px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .section {
        padding: 2.5rem 0;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .footer {
        padding: 3rem 0 1.5rem;
    }
    
    .calculator-page-header {
        padding: 1.5rem;
    }
    
    .calculator-page-header h1 {
        font-size: 1.5rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    #mainNavbar,
    .footer,
    .fullscreen-toggle-btn,
    .ad-container {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card,
    .tool-card,
    .blog-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
/* ============================================
   Page Header (Generic)
   ============================================ */
.page-header {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    padding: 4rem 0;
    color: white;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.page-header::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.5;
}

.page-header .container {
    position: relative;
    z-index: 1;
}

.page-header .breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.page-header .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-header .breadcrumb-item a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.page-header .breadcrumb-item.active {
    color: #ffffff;
    font-weight: 600;
}

.page-header .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.7);
    content: "›";
    font-size: 1.2rem;
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-header h1 i {
    margin-right: 0.5rem;
}

.page-header .lead {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 0;
    color: #ffffff;
    font-weight: 400;
    max-width: 600px;
}

[data-bs-theme="dark"] .page-header {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
}

[data-bs-theme="dark"] .page-header .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.9);
}

[data-bs-theme="dark"] .page-header .breadcrumb-item.active {
    color: #ffffff;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.page-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 0;
    color: white;
}

/* ============================================
   Background Utilities for Dark Mode
   ============================================ */
[data-bs-theme="dark"] .bg-light {
    background-color: var(--bg-secondary) !important;
}

[data-bs-theme="dark"] .bg-white {
    background-color: var(--bg-card) !important;
}

/* ============================================
   Section Styles
   ============================================ */
.section-header {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* ============================================
   Category Cards
   ============================================ */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    text-decoration: none;
    transition: all var(--transition-base);
}

.category-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.category-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.category-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    text-align: center;
}

.category-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   Tool Icon Styles
   ============================================ */
.tool-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background-color: var(--primary-100);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--brand-primary);
    transition: all var(--transition-base);
}

[data-bs-theme="dark"] .tool-icon {
    background-color: rgba(6, 182, 212, 0.15);
}

.tool-card:hover .tool-icon {
    background-color: var(--brand-primary);
    color: white;
    transform: scale(1.1);
}

.tool-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.tool-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-grow: 1;
    margin-bottom: 1rem;
}

.tool-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: var(--radius-full);
}

.badge-popular {
    background-color: var(--danger-bg);
    color: var(--danger);
}

.badge-new {
    background-color: var(--success-bg);
    color: var(--success);
}

.badge-featured {
    background-color: var(--warning-bg);
    color: var(--warning);
}

.badge-updated {
    background-color: var(--info-bg);
    color: var(--info);
}

/* ============================================
   Tool Card Horizontal
   ============================================ */
.tool-card-horizontal {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.tool-card-horizontal:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-md);
}

.tool-icon-small {
    width: 48px;
    height: 48px;
    background-color: var(--primary-100);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--brand-primary);
    margin-right: 1rem;
    flex-shrink: 0;
}

[data-bs-theme="dark"] .tool-icon-small {
    background-color: rgba(6, 182, 212, 0.15);
}

.tool-content {
    flex: 1;
    min-width: 0;
}

/* ============================================
   Coming Soon Banner
   ============================================ */
.coming-soon-banner {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    text-align: center;
}

.coming-soon-content {
    color: white;
    font-weight: 500;
}

/* ============================================
   Featured Section Background
   ============================================ */
.featured-section {
    background-color: var(--bg-secondary);
}

[data-bs-theme="dark"] .featured-section {
    background-color: var(--bg-primary);
}

/* ============================================
   Newsletter Section
   ============================================ */
.newsletter-section {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    padding: 4rem 0;
    color: white;
}

.newsletter-section h2 {
    color: white;
}

.newsletter-section p {
    color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   About Page Styles
   ============================================ */
.about-hero {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    padding: 4rem 0;
    color: white;
}

.about-hero h1 {
    color: white;
}

.about-hero p {
    color: rgba(255, 255, 255, 0.9);
}

.feature-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    height: 100%;
    transition: all var(--transition-base);
}

.feature-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background-color: var(--primary-100);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--brand-primary);
    margin-bottom: 1.5rem;
}

[data-bs-theme="dark"] .feature-icon {
    background-color: rgba(6, 182, 212, 0.15);
}

/* ============================================
   Contact Page Styles
   ============================================ */
.contact-hero {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    padding: 4rem 0;
    color: white;
}

.contact-hero h1 {
    color: white;
}

.contact-hero p {
    color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   Form Styles Enhancement
   ============================================ */
.form-control,
.form-select {
    background-color: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-input);
    border-color: var(--brand-primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: var(--bg-input);
    border-color: var(--brand-primary);
}

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

/* ============================================
   Alert Styles
   ============================================ */
.alert {
    border-radius: var(--radius-lg);
    border: none;
}

.alert-success {
    background-color: var(--success-bg);
    color: var(--success);
}

.alert-danger {
    background-color: var(--danger-bg);
    color: var(--danger);
}

.alert-warning {
    background-color: var(--warning-bg);
    color: var(--warning);
}

.alert-info {
    background-color: var(--info-bg);
    color: var(--info);
}

/* ============================================
   Card Enhancements
   ============================================ */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.card-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.card-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

/* ============================================
   Table Styles
   ============================================ */
.table {
    color: var(--text-primary);
}

.table thead th {
    background-color: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
}

.table td {
    border-color: var(--border-color);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--bg-secondary);
}

/* ============================================
   Breadcrumb Styles
   ============================================ */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--brand-primary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

/* ============================================
   Pagination Styles
   ============================================ */
.pagination {
    gap: 0.25rem;
}

.page-link {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.875rem;
}

.page-link:hover {
    background-color: var(--bg-secondary);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.page-item.active .page-link {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}

.page-item.disabled .page-link {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-muted);
}

/* ============================================
   Modal Styles
   ============================================ */
.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

.modal-title {
    color: var(--text-primary);
}

.btn-close {
    filter: var(--btn-close-filter, none);
}

[data-bs-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ============================================
   Dropdown Styles
   ============================================ */
.dropdown-menu {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.dropdown-item {
    color: var(--text-primary);
    padding: 0.5rem 1rem;
}

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

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--brand-primary);
    color: white;
}

.dropdown-divider {
    border-color: var(--border-color);
}

.dropdown-header {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   Input Group Styles
   ============================================ */
.input-group-text {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

[data-bs-theme="dark"] .input-group-text {
    background-color: var(--bg-tertiary);
}

/* ============================================
   Badge Styles
   ============================================ */
.badge {
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: var(--radius-full);
}

.badge.bg-primary {
    background-color: var(--brand-primary) !important;
}

.badge.bg-secondary {
    background-color: var(--gray-500) !important;
}

.badge.bg-success {
    background-color: var(--success) !important;
}

.badge.bg-danger {
    background-color: var(--danger) !important;
}

.badge.bg-warning {
    background-color: var(--warning) !important;
    color: var(--gray-900) !important;
}

.badge.bg-info {
    background-color: var(--info) !important;
}

/* ============================================
   List Group Styles
   ============================================ */
.list-group-item {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.list-group-item:hover {
    background-color: var(--bg-secondary);
}

.list-group-item.active {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

/* ============================================
   Accordion Styles
   ============================================ */
.accordion-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
}

.accordion-button {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.accordion-button:not(.collapsed) {
    background-color: var(--bg-secondary);
    color: var(--brand-primary);
}

.accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.accordion-body {
    background-color: var(--bg-card);
}

/* ============================================
   Nav Tabs & Pills
   ============================================ */
.nav-tabs {
    border-bottom: 1px solid var(--border-color);
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
}

.nav-tabs .nav-link:hover {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
}

.nav-tabs .nav-link.active {
    color: var(--brand-primary);
    background-color: transparent;
    border-bottom-color: var(--brand-primary);
}

.nav-pills .nav-link {
    color: var(--text-secondary);
    border-radius: var(--radius-md);
}

.nav-pills .nav-link:hover {
    background-color: var(--bg-secondary);
    color: var(--brand-primary);
}

.nav-pills .nav-link.active {
    background-color: var(--brand-primary);
    color: white;
}

/* ============================================
   Progress Bar Styles
   ============================================ */
.progress {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-full);
    height: 0.75rem;
}

.progress-bar {
    background-color: var(--brand-primary);
    border-radius: var(--radius-full);
}

/* ============================================
   Spinner Styles
   ============================================ */
.spinner-border {
    color: var(--brand-primary);
}

.spinner-grow {
    color: var(--brand-primary);
}

/* ============================================
   Toast Styles
   ============================================ */
.toast {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.toast-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

/* ============================================
   Tooltip & Popover Styles
   ============================================ */
.tooltip-inner {
    background-color: var(--gray-800);
    border-radius: var(--radius-md);
}

.popover {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.popover-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

/* ============================================
   Offcanvas Styles
   ============================================ */
.offcanvas {
    background-color: var(--bg-card);
}

.offcanvas-header {
    border-bottom: 1px solid var(--border-color);
}

.offcanvas-title {
    color: var(--text-primary);
}

/* ============================================
   Scrollbar Styles
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--gray-600);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* ============================================
   Selection Styles
   ============================================ */
::selection {
    background-color: var(--brand-primary);
    color: white;
}

::-moz-selection {
    background-color: var(--brand-primary);
    color: white;
}

/* ============================================
   Focus Visible Styles
   ============================================ */
:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Blog notification badge */
.blog-badge {
    font-size: 0.65rem;
    padding: 0.2em 0.5em;
    position: relative;
    top: -8px;
    margin-left: 2px;
    font-weight: 600;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Stop animation after page load */
.blog-badge:hover {
    animation: none;
    transform: scale(1.1);
}
