/* Base mobile styles (320px and up) */
@media (max-width: 768px) {
    /* Enhanced mobile navigation */
    .navbar {
        padding: 0.75rem 1rem;
        backdrop-filter: blur(10px);
    }
    
    .navbar-brand {
        font-size: 1.1rem;
        padding: 0.5rem 0;
    }
    
    .navbar-toggler {
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
        border-radius: 8px;
        border: 2px solid var(--brand-primary);
        background: rgba(79, 70, 229, 0.12);
    }
    
    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.25);
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: 8px;
        margin: 0.25rem 0;
        transition: all 0.3s ease;
    }
    
    .navbar-nav .nav-link:hover {
        background: rgba(79, 70, 229, 0.12);
        transform: translateX(5px);
    }
    
    .navbar-nav .nav-link i {
        width: 20px;
        text-align: center;
        margin-right: 0.5rem;
    }
    
    .dropdown-menu-modern {
        border-radius: 12px;
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        margin-top: 0.5rem;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
        border-radius: 8px;
        margin: 0.25rem;
        font-size: 0.95rem;
    }
    
    /* Hero section mobile optimization */
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .hero-actions .btn {
        width: 100%;
        max-width: 280px;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        border-radius: 12px;
    }
    
    /* Enhanced mobile blog cards */
    .blog-card {
        margin-bottom: 2rem;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: var(--shadow-md);
        transition: all 0.3s ease;
    }
    
    .blog-card:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: var(--shadow-xl);
    }
    
    .blog-card-image {
        height: 200px;
        position: relative;
        overflow: hidden;
    }
    
    .blog-card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.5s ease;
    }
    
    .blog-card:hover .blog-card-image img {
        transform: scale(1.1);
    }
    
    .blog-card-content {
        padding: 1.75rem;
    }
    
    .blog-title {
        font-size: 1.3rem;
        font-weight: 600;
        line-height: 1.4;
        margin-bottom: 1rem;
    }
    
    .blog-title a {
        color: var(--text-primary);
        text-decoration: none;
        transition: color 0.3s ease;
    }
    
    .blog-title a:hover {
        color: var(--primary-gold);
    }
    
    .blog-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        margin-bottom: 1.25rem;
        font-size: 0.85rem;
        color: var(--text-secondary);
    }
    
    .blog-meta-item {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.4rem 0.8rem;
        background: var(--bg-secondary);
        border-radius: 20px;
        font-size: 0.8rem;
    }
    
    .blog-meta-item i {
        color: var(--primary-gold);
        font-size: 0.9rem;
    }
    
    .blog-excerpt {
        font-size: 0.95rem;
        line-height: 1.6;
        color: var(--text-secondary);
        margin-bottom: 1.5rem;
        display: -webkit-box;
        line-clamp: 3;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .blog-tags {
        margin-bottom: 1.5rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .tag-badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
        border-radius: 15px;
        background: var(--gradient-gold-subtle);
        color: var(--text-primary);
        border: 1px solid var(--primary-gold-light);
        transition: all 0.3s ease;
    }
    
    .tag-badge:hover {
        background: var(--primary-gold);
        color: white;
        transform: translateY(-2px);
    }
    
    .read-more-btn {
        background: var(--gradient-brand);
        border: none;
        color: var(--text-dark);
        padding: 0.75rem 1.5rem;
        border-radius: 25px;
        font-weight: 500;
        font-size: 0.9rem;
        transition: all 0.3s ease;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
        justify-content: center;
    }
    
    .read-more-btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
        color: var(--text-dark);
    }
    
    .category-badge {
        position: absolute;
        top: 1rem;
        left: 1rem;
        padding: 0.5rem 1rem;
        background: var(--gradient-brand);
        color: var(--text-dark);
        border-radius: 20px;
        font-size: 0.8rem;
        font-weight: 500;
        z-index: 2;
        box-shadow: var(--shadow-sm);
    }
    
    /* Rate cards mobile optimization */
    .rate-value {
        font-size: 1.5rem;
        font-weight: 700;
    }
    
    .rate-card {
        padding: 1.25rem;
        border-radius: 15px;
        margin-bottom: 1rem;
    }
    
    .stats-number {
        font-size: 2rem;
        font-weight: 700;
    }
    
    .stats-icon {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
    }
    
    .chart-container {
        padding: 1.25rem;
        border-radius: 15px;
    }
    
    /* Staggered animations for mobile */
    .animate-on-scroll:nth-child(n) {
        transition-delay: 0.1s;
    }
    
    /* Touch-friendly interactions */
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
        border-radius: 12px;
        min-height: 44px; /* iOS recommended touch target */
        transition: all 0.3s ease;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    .form-control {
        padding: 0.875rem 1rem;
        font-size: 1rem;
        border-radius: 12px;
        min-height: 44px;
    }
    
    .form-control:focus {
        box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.25);
        border-color: var(--primary-gold);
    }
    
    /* Mobile tables */
    .table-responsive {
        border-radius: 15px;
        overflow: hidden;
        box-shadow: var(--shadow-sm);
    }
    
    .table {
        margin-bottom: 0;
    }
    
    .table th {
        background: var(--gradient-gold-subtle);
        color: var(--text-primary);
        font-weight: 600;
        padding: 1rem;
        border: none;
    }
    
    .table td {
        padding: 1rem;
        vertical-align: middle;
        border-color: var(--border-color);
    }
}

/* Extra small screen optimizations (320px - 575px) */
@media (max-width: 576px) {
    /* Typography improvements for small screens */
    h1 {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.3rem;
        line-height: 1.3;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    /* Container optimizations */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Hero section mobile optimization */
    .hero-title {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .hero-actions .btn {
        width: 100%;
        margin: 0;
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    
    /* Blog cards mobile optimization */
    .blog-card {
        margin-bottom: 1.25rem;
        border-radius: 18px;
    }
    
    .blog-card-image {
        height: 160px;
    }
    
    .blog-card-content {
        padding: 1.25rem;
    }
    
    .blog-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .blog-excerpt {
        font-size: 0.9rem;
        margin-bottom: 1.25rem;
        line-clamp: 2;
        -webkit-line-clamp: 2;
    }
    
    .blog-meta {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .blog-meta-item {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .read-more-btn {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Rate cards mobile optimization */
    .rate-value {
        font-size: 1.25rem;
    }
    
    .stats-number {
        font-size: 1.5rem;
    }
    
    .stats-icon {
        font-size: 1.8rem;
    }
    
    .rate-card {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .chart-container {
        padding: 1rem;
    }
    
    /* Form optimizations */
    .form-control {
        padding: 0.75rem 0.875rem;
        font-size: 1rem;
        border-radius: 10px;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        border-radius: 10px;
    }
    
/* Search form mobile optimization */
.search-form {
    flex-direction: column;
    gap: 0.75rem;
}

/* Blog card defaults (desktop) */
.blog-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
    height: 100%;
    border: 1px solid var(--border-color);
}
.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-primary-light);
}
.blog-card-image {
    height: 250px;
    background: var(--gradient-brand);
    position: relative;
    overflow: hidden;
}
.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.blog-card:hover .blog-card-image img { transform: scale(1.05); }
.blog-card-content { padding: 25px; }
.blog-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.blog-title { font-size: 1.4rem; font-weight: 600; margin-bottom: 15px; line-height: 1.4; }
.blog-title a { color: var(--text-primary); text-decoration: none; transition: var(--transition-fast); }
.blog-title a:hover { color: var(--brand-primary); }
.blog-excerpt { color: var(--text-secondary); line-height: 1.6; margin-bottom: 20px; }
.tag-badge {
    background: var(--gradient-brand);
    color: var(--brand-primary-dark);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    text-decoration: none;
    margin-right: 8px;
    margin-bottom: 5px;
    display: inline-block;
    transition: var(--transition-fast);
    border: 1px solid var(--border-color);
}
.category-badge { background: var(--gradient-brand); color: white; padding: 6px 12px; border-radius: 20px; font-size: 0.8rem; text-decoration: none; font-weight: 500; }
.read-more-btn { background: var(--gradient-brand); color: white; text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 20px; transition: var(--transition-fast); }
.read-more-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: white; text-decoration: none; }
    
    .search-form .form-control {
        margin-bottom: 0;
        border-radius: 10px;
    }
    
    .search-form .btn {
        border-radius: 10px;
        width: 100%;
    }
    
    /* Post meta mobile optimization */
    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
        text-align: left;
        align-items: flex-start;
    }
    
    .post-meta-item {
        font-size: 0.8rem;
        padding: 0.25rem 0;
    }
    
    /* Sidebar mobile optimization */
    .sidebar .card {
        margin-bottom: 1rem;
        border-radius: 15px;
    }
    
    .sidebar .card-body {
        padding: 1.25rem;
    }
    
    /* Better spacing for mobile */
    .section {
        padding: 30px 0;
    }
    
    .mb-4 {
        margin-bottom: 1.25rem !important;
    }
    
    .mt-4 {
        margin-top: 1.25rem !important;
    }
    
    .mb-3 {
        margin-bottom: 1rem !important;
    }
    
    .mt-3 {
        margin-top: 1rem !important;
    }
    
    /* Mobile tables */
    .table-responsive {
        border-radius: 12px;
        margin-bottom: 1rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    /* Mobile dropdowns */
    .dropdown-menu {
        border-radius: 12px;
        font-size: 0.9rem;
    }
    
    .dropdown-item {
        padding: 0.5rem 0.75rem;
    }
    
    /* Mobile alerts */
    .alert {
        padding: 0.75rem 1rem;
        border-radius: 10px;
        font-size: 0.9rem;
    }
    
    /* Mobile pagination */
    .pagination {
        margin: 1rem 0;
    }
    
    .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    /* Dark mode toggle mobile optimization */
    .theme-toggle {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        right: 15px;
    }
    
    /* Mobile-specific utilities */
    .mobile-text-center {
        text-align: center !important;
    }
    
    .mobile-mb-1 {
        margin-bottom: 0.5rem !important;
    }
    
    .mobile-mb-2 {
        margin-bottom: 1rem !important;
    }
    
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    /* Mobile card optimizations */
    .card {
        border-radius: 15px;
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .card-title {
        font-size: 1.05rem;
        margin-bottom: 0.75rem;
    }
    
    /* Mobile button groups */
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        border-radius: 8px !important;
        margin-bottom: 0.5rem;
        width: 100%;
    }
    
    .btn-group .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Version control dashboard mobile optimizations */
    .snapshot-card {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .snapshot-info {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .snapshot-actions {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .snapshot-actions .btn {
        width: 100%;
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }
    
    .rollback-log-entry {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .rollback-log-info {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .rollback-status {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Mobile form optimizations for version control */
    .create-snapshot-form {
        padding: 1rem;
    }
    
    .create-snapshot-form .form-group {
        margin-bottom: 1rem;
    }
    
    .create-snapshot-form .form-control {
        font-size: 1rem;
        padding: 0.75rem;
    }
    
    .create-snapshot-form .btn {
        width: 100%;
        padding: 0.875rem;
        font-size: 0.95rem;
    }
    
    /* Mobile table optimizations for version control */
    .snapshots-table {
        font-size: 0.8rem;
    }
    
    .snapshots-table th,
    .snapshots-table td {
        padding: 0.5rem 0.25rem;
    }
    
    .snapshots-table .btn-sm {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
        margin: 0.125rem;
    }
    
    /* Mobile modal optimizations */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 15px;
    }
    
    .modal-header {
        padding: 1rem;
        border-radius: 15px 15px 0 0;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
    
    /* Mobile navigation improvements */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    
    .dropdown-menu {
        border-radius: 12px;
        font-size: 0.9rem;
        margin-top: 0.5rem;
    }
    
    /* Mobile-specific version control utilities */
    .vc-mobile-stack {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .vc-mobile-full {
        width: 100% !important;
    }
    
    .vc-mobile-text-small {
        font-size: 0.8rem !important;
    }
    
    .vc-mobile-mb-1 {
        margin-bottom: 0.5rem !important;
    }
    
    .vc-mobile-gap-1 {
        gap: 0.5rem !important;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

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

.slide-up {
    animation: slideUp 0.6s ease-out;
}

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

/* Utility Classes */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.border-gold {
    border-color: var(--brand-primary) !important;
}

.bg-light-gold {
    background-color: rgba(79, 70, 229, 0.1) !important;
}

.rounded-lg {
    border-radius: 15px !important;
}

.shadow-gold {
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.2) !important;
}

/* Cookie Consent Banner Styles */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    border-top: 3px solid #3498db;
    animation: slideUp 0.5s ease-out;
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cookie-consent-text h5 {
    margin-bottom: 8px;
    color: #3498db;
    font-weight: 600;
}

.cookie-consent-text p {
    margin-bottom: 0;
    font-size: 14px;
    line-height: 1.5;
}

.cookie-consent-text a {
    color: #3498db;
    text-decoration: underline;
}

.cookie-consent-text a:hover {
    color: #5dade2;
}

.cookie-consent-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-consent-buttons .btn {
    white-space: nowrap;
    font-size: 13px;
    padding: 8px 16px;
}

/* Cookie Settings Button (floating) */
.cookie-settings-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
    z-index: 9998;
    font-size: 18px;
}

.cookie-settings-btn:hover {
    background: #2980b9;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* Cookie Preferences Modal Styles */
.cookie-category {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    background: #f8f9fa;
}

.cookie-category h6 {
    font-weight: 600;
}

.cookie-category .form-check-input:checked {
    background-color: #3498db;
    border-color: #3498db;
}

.cookie-category .form-check-input:disabled {
    background-color: #28a745;
    border-color: #28a745;
    opacity: 0.8;
}

/* Dark mode cookie preferences */
[data-theme="dark"] .cookie-category {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .cookie-consent {
    background: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .cookie-consent-text {
    color: var(--text-primary);
}

[data-theme="dark"] .cookie-consent-text a {
    color: var(--primary-gold);
}

[data-theme="dark"] .cookie-settings-btn {
    background: var(--primary-gold);
    color: #000;
}

[data-theme="dark"] .cookie-settings-btn:hover {
    background: var(--primary-gold-dark);
    color: #000;
}

/* Animations */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .cookie-consent-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .cookie-consent-buttons .btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .cookie-settings-btn {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .cookie-consent-banner {
        padding: 15px;
    }
    
    .cookie-consent-text h5 {
        font-size: 16px;
    }
    
    .cookie-consent-text p {
        font-size: 13px;
    }
    
    .cookie-consent-buttons .btn {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    /* Ultra-small screen optimizations */
    .hero-section {
        min-height: 60vh;
        padding: 40px 0;
    }
    
    .hero-title {
        font-size: 1.6rem;
        line-height: 1.3;
    }
    
    .hero-description {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .stat-item {
        text-align: center;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-toggler {
        padding: 6px 8px;
        min-width: 44px;
        min-height: 44px;
        font-size: 1rem;
    }
    
    .blog-card-content {
        padding: 15px;
    }
    
    .blog-card-title {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .blog-card-excerpt {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .post-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .post-excerpt {
        font-size: 0.95rem;
    }
    
    .sidebar {
        margin-top: 20px;
    }

    /* Recent Posts tweaks to prevent overflow/scrollbars */
    .sidebar .recent-post-title {
        font-size: 0.9rem;
        line-height: 1.3;
        margin: 0;
    }
    .sidebar .recent-post-title a {
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .card {
        border-radius: 10px;
    }
    
    .card-header {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .list-group-item {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    /* Improved form elements for tiny screens */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .form-select {
        font-size: 16px;
    }
    
    /* Better modal experience */
    .modal-dialog {
        margin: 5px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-footer {
        padding: 15px;
    }
}

/* Additional custom styles can be added here */

/* Color Scheme Overrides: set brand variables per scheme */
:root[data-color-scheme="bolbaba"] {
    --brand-primary: #4F46E5; /* Indigo */
    --brand-primary-dark: #3730A3;
    --brand-primary-light: #A5B4FC;
    --brand-secondary: #8B5CF6; /* Violet from logo */
    --brand-accent: #14B8A6; /* Mint accent from quill */
}

:root[data-color-scheme="royal"] {
    --brand-primary: #7C3AED; /* Violet */
    --brand-primary-dark: #5B21B6;
    --brand-primary-light: #C4B5FD;
    --brand-secondary: #F472B6; /* Pink */
    --brand-accent: #EC4899; /* Pink deeper */
}

:root[data-color-scheme="ocean"] {
    --brand-primary: #0EA5E9; /* Sky */
    --brand-primary-dark: #0369A1;
    --brand-primary-light: #93C5FD;
    --brand-secondary: #22D3EE; /* Cyan */
    --brand-accent: #10B981; /* Emerald */
}

:root[data-color-scheme="emerald"] {
    --brand-primary: #10B981; /* Emerald */
    --brand-primary-dark: #047857;
    --brand-primary-light: #6EE7B7;
    --brand-secondary: #84CC16; /* Lime */
    --brand-accent: #22D3EE; /* Cyan */
}

:root[data-color-scheme="sunset"] {
    --brand-primary: #F59E0B; /* Amber */
    --brand-primary-dark: #B45309;
    --brand-primary-light: #FDE68A;
    --brand-secondary: #F97316; /* Orange */
    --brand-accent: #FB7185; /* Rose */
}

:root[data-color-scheme="berry"] {
    --brand-primary: #EF4444; /* Red */
    --brand-primary-dark: #991B1B;
    --brand-primary-light: #FCA5A5;
    --brand-secondary: #F43F5E; /* Rose */
    --brand-accent: #FB7185; /* Rose light */
}

:root[data-color-scheme="forest"] {
    --brand-primary: #166534; /* Green 700 */
    --brand-primary-dark: #14532D;
    --brand-primary-light: #86EFAC;
    --brand-secondary: #4D7C0F; /* Lime 700 */
    --brand-accent: #22C55E; /* Green 500 */
}

:root[data-color-scheme="midnight"] {
    --brand-primary: #1E293B; /* Slate 800 */
    --brand-primary-dark: #0F172A; /* Slate 900 */
    --brand-primary-light: #94A3B8; /* Slate 400 */
    --brand-secondary: #3B82F6; /* Blue 500 */
    --brand-accent: #38BDF8; /* Sky 400 */
}

:root[data-color-scheme="aurora"] {
    --brand-primary: #14B8A6; /* Teal */
    --brand-primary-dark: #0F766E;
    --brand-primary-light: #99F6E4;
    --brand-secondary: #8B5CF6; /* Violet */
    --brand-accent: #06B6D4; /* Cyan */
}

:root[data-color-scheme="copper"] {
    --brand-primary: #D97706; /* Amber 600 */
    --brand-primary-dark: #78350F;
    --brand-primary-light: #FCD34D;
    --brand-secondary: #B45309; /* Orange 700 */
    --brand-accent: #92400E; /* Amber 800 */
}

/* Footer integration */
footer {
    position: relative;
}

/* Scheme-bound footer background */
.site-footer {
    background-color: var(--brand-primary-dark);
    color: #ffffff;
}

.site-footer hr {
    border-color: rgba(255, 255, 255, 0.15);
}

footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-brand);
}

/* Brand gradient and text helpers */
:root {
    --gradient-brand: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);

    /* Base tokens */
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-dark: #000000;
    --border-color: #dee2e6;
    --bg-secondary: #f8f9fa;
    --card-bg: #ffffff;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.16);
    --shadow-xl: 0 15px 30px rgba(0,0,0,0.20);

    /* Legacy gold aliases mapped to brand */
    --primary-gold: var(--brand-primary);
    --primary-gold-dark: var(--brand-primary-dark);
    --primary-gold-light: var(--brand-primary-light);
    --gradient-gold: var(--gradient-brand);
    --gradient-gold-subtle: var(--gradient-brand);
}

/* Dark theme base tokens */
:root[data-theme="dark"] {
    --text-primary: #e5e7eb; /* slate-200 */
    --text-secondary: #9ca3af; /* slate-400 */
    --border-color: #334155; /* slate-700 */
    --bg-secondary: #1f2937; /* slate-800 */
    --card-bg: var(--brand-primary-dark);

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.60);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.50);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.45);
    --shadow-xl: 0 15px 30px rgba(0,0,0,0.40);
}

.text-brand {
    color: var(--brand-primary) !important;
}

/* Footer link colors aligned to scheme */
footer a {
    color: var(--brand-primary-light) !important;
    transition: color 0.2s ease;
    display: inline-block;
    position: relative;
}

/* Gradient underline on hover for visibility */
footer a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: var(--gradient-brand);
    opacity: 0.7;
    transition: width 0.2s ease, opacity 0.2s ease;
}

footer a:hover,
footer a:focus {
    color: var(--brand-secondary) !important;
    text-decoration: none;
}

footer a:hover::after,
footer a:focus::after {
    width: 100%;
    opacity: 1;
}

footer .social-links a:hover {
    color: var(--brand-secondary) !important;
}

/* Footer scheme-bound elements */
.footer-title {
    color: var(--brand-primary);
}

.footer-logo {
    height: 32px;
    width: auto;
    vertical-align: middle;
}

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

.btn-brand:hover,
.btn-brand:focus {
    background-color: var(--brand-secondary);
    border-color: var(--brand-secondary);
    color: #ffffff;
}

.btn-outline-brand {
    background: transparent;
    color: var(--brand-primary);
    border: 2px solid var(--brand-primary);
    transition: all 0.3s ease;
}

.btn-outline-brand:hover,
.btn-outline-brand:focus {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
}

/* Map Bootstrap primary buttons to brand */
.btn-primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #ffffff;
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--brand-secondary);
    border-color: var(--brand-secondary);
    color: #ffffff;
}
.btn-outline-primary {
    background: transparent;
    color: var(--brand-primary);
    border: 2px solid var(--brand-primary);
    transition: all 0.3s ease;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
}

/* Map Bootstrap utility colors to brand */
.text-primary { color: var(--brand-primary) !important; }
.border-primary { border-color: var(--brand-primary) !important; }
.bg-primary { background-color: var(--brand-primary) !important; }

/* Navbar refinements for bolbaba scheme */
.navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(8px);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.navbar .navbar-brand {
    color: var(--brand-primary);
}
.navbar .nav-link {
    color: var(--brand-primary);
    font-weight: 500;
}
.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: var(--brand-secondary);
    text-decoration: none;
}
.navbar .dropdown-menu {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.navbar .dropdown-item:hover {
    color: #ffffff;
    background: var(--gradient-brand);
}
.navbar .navbar-toggler {
    border-color: var(--brand-primary);
}
.navbar-light .navbar-toggler:focus {
    box-shadow: 0 0 0 0.15rem rgba(79, 70, 229, 0.25);
}

/* Dark mode navbar refinements */
:root[data-theme="dark"] .navbar {
    background: rgba(18, 18, 20, 0.88);
    backdrop-filter: saturate(180%) blur(8px);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
:root[data-theme="dark"] .navbar .navbar-brand {
    color: rgba(255, 255, 255, 0.92);
}
:root[data-theme="dark"] .navbar .nav-link {
    color: var(--brand-primary-light);
}
:root[data-theme="dark"] .navbar .nav-link:hover,
:root[data-theme="dark"] .navbar .nav-link:focus {
    color: var(--brand-secondary);
    text-decoration: none;
}
:root[data-theme="dark"] .navbar .dropdown-menu {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
:root[data-theme="dark"] .navbar .dropdown-item {
    color: var(--text-primary);
}
:root[data-theme="dark"] .navbar .dropdown-item:hover {
    color: #ffffff;
    background: var(--gradient-brand);
}
:root[data-theme="dark"] .navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.6);
}
:root[data-theme="dark"] .navbar-light .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
:root[data-theme="dark"] .navbar-light .navbar-toggler:focus {
    box-shadow: 0 0 0 0.15rem rgba(79, 70, 229, 0.35);
}

/* Footer readability improvements */
.site-footer,
.site-footer a,
.site-footer p,
.site-footer li,
.site-footer small {
    color: rgba(255, 255, 255, 0.92);
}
.site-footer .text-muted {
    color: rgba(255, 255, 255, 0.80) !important;
}
.site-footer a:hover,
.site-footer a:focus {
    color: #ffffff;
    text-decoration: none;
}