/**
 * Theme 13 - TradingMonday Custom Color Scheme
 * Google Blue (#1a73e8) professional theme
 * Compatible with Bootstrap 5
 */

/* ========================================
   CSS CUSTOM PROPERTIES (Variables)
   ======================================== */

:root {
    /* Primary Colors - Google Blue */
    --tm-primary: #1a73e8;
    --tm-primary-dark: #1557b0;
    --tm-primary-light: #4285f4;
    --tm-primary-rgb: 26, 115, 232;

    /* Secondary Colors - Medium Slate */
    --tm-secondary: #475569;
    --tm-secondary-dark: #334155;
    --tm-secondary-light: #64748b;
    --tm-secondary-rgb: 71, 85, 105;

    /* Text Colors */
    --tm-text-primary: #0f172a;
    --tm-text-secondary: #64748b;
    --tm-text-muted: #94a3b8;

    /* Background Colors */
    --tm-bg-body: #ffffff;
    --tm-bg-light: #f1f5f9;
    --tm-bg-hover: rgba(51, 65, 85, 0.05);
    --tm-bg-card: #ffffff;

    /* Border Colors */
    --tm-border: #e2e8f0;
    --tm-border-light: #f1f5f9;
    --tm-border-dark: #cbd5e1;

    /* State Colors */
    --tm-success: #10b981;
    --tm-warning: #f59e0b;
    --tm-danger: #ef4444;
    --tm-info: #3b82f6;

    /* Shadows */
    --tm-shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --tm-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.1), 0 1px 2px -1px rgba(15, 23, 42, 0.1);
    --tm-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.1), 0 2px 4px -2px rgba(15, 23, 42, 0.1);
    --tm-shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.1);

    /* Transitions */
    --tm-transition: all 0.2s ease-in-out;
    --tm-transition-fast: all 0.15s ease-in-out;
}

/* ========================================
   BOOTSTRAP OVERRIDES - Force Theme 13 Colors
   ======================================== */

/* Override Bootstrap CSS Variables Globally */
:root {
    /* Override Bootstrap Primary */
    --bs-primary: #1a73e8;
    --bs-primary-rgb: 26, 115, 232;
    --bs-primary-text-emphasis: #1557b0;
    --bs-primary-bg-subtle: rgba(26, 115, 232, 0.1);
    --bs-primary-border-subtle: rgba(26, 115, 232, 0.2);

    /* Override Bootstrap Secondary */
    --bs-secondary: #475569;
    --bs-secondary-rgb: 71, 85, 105;
    --bs-secondary-text-emphasis: #334155;
    --bs-secondary-bg-subtle: rgba(71, 85, 105, 0.1);
    --bs-secondary-border-subtle: rgba(71, 85, 105, 0.2);

    /* Override Bootstrap Link Colors */
    --bs-link-color: #334155;
    --bs-link-hover-color: #1e293b;

    /* Override Bootstrap Body Colors */
    --bs-body-color: #0f172a;
    --bs-body-bg: #ffffff;

    /* Override Bootstrap Border */
    --bs-border-color: #e2e8f0;
    --bs-border-color-translucent: rgba(226, 232, 240, 0.5);
}

/* ========================================
   BUTTONS - Force Theme 13 Colors
   ======================================== */

/* Primary Button */
.btn-primary,
.btn-primary:link,
.btn-primary:visited {
    background-color: var(--tm-primary) !important;
    border-color: var(--tm-primary) !important;
    color: #ffffff !important;
    transition: var(--tm-transition);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:focus-visible,
.btn-primary:active {
    background-color: var(--tm-primary-dark) !important;
    border-color: var(--tm-primary-dark) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.2) !important;
}

.btn-check:checked + .btn-primary,
.btn-check:active + .btn-primary,
.btn-primary.active,
.btn-primary:active,
.show > .btn-primary.dropdown-toggle {
    background-color: var(--tm-primary-dark) !important;
    border-color: var(--tm-primary-dark) !important;
    color: #ffffff !important;
}

/* Primary Soft Button (Light Background) */
.btn-primary-soft,
.btn-primary-soft:link,
.btn-primary-soft:visited {
    background-color: rgba(26, 115, 232, 0.1) !important;
    border-color: transparent !important;
    color: var(--tm-primary) !important;
    transition: var(--tm-transition);
}

.btn-primary-soft:hover,
.btn-primary-soft:focus,
.btn-primary-soft:active {
    background-color: rgba(26, 115, 232, 0.15) !important;
    color: var(--tm-primary-dark) !important;
}

/* Outline Primary Button - Using dark slate for browse/filter buttons */
.btn-outline-primary,
.btn-outline-primary:link,
.btn-outline-primary:visited {
    border-color: #334155 !important;
    color: #334155 !important;
    background-color: transparent !important;
    transition: var(--tm-transition);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background-color: #334155 !important;
    border-color: #334155 !important;
    color: #ffffff !important;
}

/* Secondary Button */
.btn-secondary {
    background-color: var(--tm-secondary);
    border-color: var(--tm-secondary);
    color: #ffffff;
    transition: var(--tm-transition);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--tm-secondary-dark);
    border-color: var(--tm-secondary-dark);
    color: #ffffff;
}

/* Light Button */
.btn-light {
    background-color: var(--tm-bg-light);
    border-color: var(--tm-border);
    color: var(--tm-text-primary);
    transition: var(--tm-transition);
}

.btn-light:hover,
.btn-light:focus {
    background-color: var(--tm-border);
    border-color: var(--tm-border-dark);
    color: var(--tm-text-primary);
}

/* ========================================
   LINKS - Dark Slate for all hyperlinks
   ======================================== */

a,
a:link,
a:visited {
    color: #334155 !important;
    text-decoration: none;
    transition: var(--tm-transition-fast);
}

a:hover,
a:focus {
    color: #1e293b !important;
}

/* Navigation Links */
.nav-link {
    color: var(--tm-text-secondary) !important;
    transition: var(--tm-transition-fast);
}

.nav-link:hover,
.nav-link:focus {
    color: #334155 !important;
}

.nav-link.active {
    color: #334155 !important;
    font-weight: 600;
}

/* Dropdown Links */
.dropdown-item {
    color: var(--tm-text-primary);
    transition: var(--tm-transition-fast);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--tm-bg-hover);
    color: #334155;
}

.dropdown-item.active {
    background-color: rgba(51, 65, 85, 0.1);
    color: #334155;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

/* Headings */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--tm-text-primary);
    font-weight: 600;
}

/* Body Text */
body {
    color: var(--tm-text-primary);
}

p {
    color: var(--tm-text-primary);
}

/* Text Utilities */
.text-primary {
    color: var(--tm-primary) !important;
}

.text-secondary {
    color: var(--tm-text-secondary) !important;
}

.text-muted {
    color: var(--tm-text-muted) !important;
}

.text-dark {
    color: var(--tm-text-primary) !important;
}

/* Small Text */
small,
.small {
    color: var(--tm-text-secondary);
}

/* ========================================
   BACKGROUNDS
   ======================================== */

/* Body Background - Light gray */
body {
    background-color: #f1f5f9 !important;
}

/* Main content area - Light gray background with bottom spacing */
main {
    background-color: #f1f5f9 !important;
    padding-bottom: 4rem !important;
    margin-bottom: 0 !important;
}

/* Header - White background */
header.header-static,
.navbar-light {
    background-color: #ffffff !important;
}

.bg-mode {
    background-color: #ffffff !important;
}

/* Card Backgrounds - White cards on light gray background */
.card {
    background-color: #ffffff !important;
    border-color: var(--tm-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: var(--tm-transition);
}

.card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Ensure card headers and footers are also white */
.card-header,
.card-footer {
    background-color: #ffffff !important;
}

/* Background Utilities */
.bg-light {
    background-color: var(--tm-bg-light) !important;
}

.bg-primary {
    background-color: var(--tm-primary) !important;
}

.bg-secondary {
    background-color: var(--tm-secondary) !important;
}

.bg-white {
    background-color: #ffffff !important;
}

/* Background with Opacity */
.bg-primary-soft,
.bg-primary.bg-opacity-10 {
    background-color: rgba(26, 115, 232, 0.1) !important;
}

.bg-success.bg-opacity-10 {
    background-color: rgba(16, 185, 129, 0.1) !important;
}

.bg-warning.bg-opacity-10 {
    background-color: rgba(245, 158, 11, 0.1) !important;
}

.bg-danger.bg-opacity-10 {
    background-color: rgba(239, 68, 68, 0.1) !important;
}

.bg-info.bg-opacity-10 {
    background-color: rgba(59, 130, 246, 0.1) !important;
}

/* Hover Background */
.hover-bg-light:hover {
    background-color: var(--tm-bg-hover);
    transition: var(--tm-transition-fast);
}

/* View Links - Clean styling for list items */
a.text-primary.small {
    text-decoration: none !important;
    font-weight: 500;
    color: #334155 !important;
}

a.text-primary.small:hover {
    text-decoration: none !important;
    color: #1e293b !important;
}

/* Card header view all links */
.card-header a.small.text-primary {
    text-decoration: none !important;
    font-weight: 500;
    color: #334155 !important;
}

.card-header a.small.text-primary:hover {
    text-decoration: underline !important;
    color: #1e293b !important;
}

/* Force Sign In button and all primary buttons to use #1a73e8 */
.btn-primary-soft,
.btn.btn-primary-soft,
a.btn-primary-soft,
button.btn-primary-soft,
.navbar .btn-primary-soft {
    background-color: rgba(26, 115, 232, 0.1) !important;
    color: #1a73e8 !important;
    border-color: transparent !important;
}

.btn-primary-soft:hover,
.btn.btn-primary-soft:hover,
a.btn-primary-soft:hover,
button.btn-primary-soft:hover,
.navbar .btn-primary-soft:hover {
    background-color: rgba(26, 115, 232, 0.15) !important;
    color: #1557b0 !important;
    border-color: transparent !important;
}

/* Force all primary colors to #1a73e8 everywhere */
*[class*="primary"] {
    --bs-primary: #1a73e8 !important;
    --bs-primary-rgb: 26, 115, 232 !important;
}

/* Text primary override - Links use dark slate, other elements use blue */
a.text-primary,
.link-primary,
a.link-primary {
    color: #334155 !important;
}

a.text-primary:hover,
.link-primary:hover,
a.link-primary:hover {
    color: #1e293b !important;
}

/* Non-link text-primary uses blue */
.text-primary:not(a) {
    color: #1a73e8 !important;
}

/* ========================================
   BORDERS
   ======================================== */

.border {
    border-color: var(--tm-border) !important;
}

.border-top {
    border-top-color: var(--tm-border) !important;
}

.border-bottom {
    border-bottom-color: var(--tm-border) !important;
}

.border-start {
    border-left-color: var(--tm-border) !important;
}

.border-end {
    border-right-color: var(--tm-border) !important;
}

/* Card Borders */
.card-header {
    border-bottom-color: var(--tm-border);
    background-color: transparent;
}

.card-footer {
    border-top-color: var(--tm-border);
    background-color: transparent;
}

/* ========================================
   BADGES
   ======================================== */

.badge {
    font-weight: 500;
    transition: var(--tm-transition-fast);
}

.badge-primary,
.badge.bg-primary {
    background-color: var(--tm-primary);
    color: #ffffff;
}

.badge-secondary,
.badge.bg-secondary {
    background-color: var(--tm-secondary);
    color: #ffffff;
}

.badge-light,
.badge.bg-light {
    background-color: var(--tm-bg-light);
    color: var(--tm-text-primary);
    border: 1px solid var(--tm-border);
}

.badge-success,
.badge.bg-success {
    background-color: var(--tm-success);
    color: #ffffff;
}

.badge-warning,
.badge.bg-warning {
    background-color: var(--tm-warning);
    color: #ffffff;
}

.badge-danger,
.badge.bg-danger {
    background-color: var(--tm-danger);
    color: #ffffff;
}

.badge-info,
.badge.bg-info {
    background-color: var(--tm-info);
    color: #ffffff;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

/* Form Controls */
.form-control {
    border-color: var(--tm-border) !important;
    color: var(--tm-text-primary) !important;
    transition: var(--tm-transition-fast);
}

.form-control:focus {
    border-color: var(--tm-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(26, 115, 232, 0.15) !important;
    color: var(--tm-text-primary) !important;
}

.form-control::placeholder {
    color: var(--tm-text-muted);
}

/* Form Select */
.form-select {
    border-color: var(--tm-border);
    color: var(--tm-text-primary);
    transition: var(--tm-transition-fast);
}

.form-select:focus {
    border-color: var(--tm-primary);
    box-shadow: 0 0 0 0.25rem rgba(26, 115, 232, 0.15);
}

/* Form Check (Checkboxes & Radio) */
.form-check-input {
    border-color: var(--tm-border);
    transition: var(--tm-transition-fast);
}

.form-check-input:checked {
    background-color: var(--tm-primary);
    border-color: var(--tm-primary);
}

.form-check-input:focus {
    border-color: var(--tm-primary);
    box-shadow: 0 0 0 0.25rem rgba(26, 115, 232, 0.15);
}

/* Input Group */
.input-group-text {
    background-color: var(--tm-bg-light);
    border-color: var(--tm-border);
    color: var(--tm-text-secondary);
}

/* ========================================
   NAVIGATION & HEADER
   ======================================== */

/* Navbar */
.navbar-light .navbar-brand {
    color: var(--tm-text-primary);
}

.navbar-light .navbar-nav .nav-link {
    color: var(--tm-text-secondary);
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link:focus {
    color: #334155;
}

.navbar-light .navbar-nav .nav-link.active {
    color: #334155;
}

.navbar-light .navbar-toggler {
    border-color: var(--tm-border);
}

/* Dropdown Menu */
.dropdown-menu {
    border-color: var(--tm-border);
    box-shadow: var(--tm-shadow-lg);
}

/* ========================================
   UTILITIES
   ======================================== */

/* Shadows */
.shadow-sm {
    box-shadow: var(--tm-shadow-sm) !important;
}

.shadow {
    box-shadow: var(--tm-shadow) !important;
}

.shadow-md {
    box-shadow: var(--tm-shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--tm-shadow-lg) !important;
}

/* Rounded Corners */
.rounded {
    border-radius: 0.375rem;
}

.rounded-pill {
    border-radius: 50rem;
}

/* Opacity Utilities */
.opacity-10 {
    opacity: 0.1;
}

.opacity-25 {
    opacity: 0.25;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-75 {
    opacity: 0.75;
}

/* ========================================
   CUSTOM COMPONENTS
   ======================================== */

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--tm-primary) 0%, var(--tm-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Gradient Background */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--tm-primary) 0%, var(--tm-primary-light) 100%);
}

/* Icon Boxes */
.icon-md {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-lg {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Sidebar item links - Full row clickable with hover effect */
.sidebar-item-link {
    transition: var(--tm-transition-fast);
    cursor: pointer;
}

.sidebar-item-link:hover {
    background-color: rgba(26, 115, 232, 0.03) !important;
    text-decoration: none !important;
}

.sidebar-item-link:hover .text-dark {
    color: #1a73e8 !important;
}

/* Remove border from last sidebar item */
.sidebar-item-link:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Resource Thumbnails */
.resource-thumb {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.resource-detail-thumb {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.related-thumb {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

/* Hover Effects */
.related-item:hover {
    background-color: var(--tm-bg-hover);
    transition: var(--tm-transition-fast);
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

/* Mobile Optimizations */
@media (max-width: 768px) {
    .card {
        box-shadow: var(--tm-shadow-sm);
    }

    h1, .h1 {
        font-size: 1.75rem;
    }

    h2, .h2 {
        font-size: 1.5rem;
    }
}

/* Tablet Optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    .card {
        box-shadow: var(--tm-shadow);
    }
}

/* Desktop Optimizations */
@media (min-width: 1025px) {
    .card:hover {
        box-shadow: var(--tm-shadow-md);
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Focus Styles */
a:focus,
button:focus,
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--tm-primary);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   CATCH-ALL OVERRIDES
   Force all Bootstrap primary colors to Theme 13
   ======================================== */

/* Force all .text-primary to use Theme 13 */
.text-primary,
.link-primary {
    color: var(--tm-primary) !important;
}

/* Force all .bg-primary to use Theme 13 */
.bg-primary {
    background-color: var(--tm-primary) !important;
}

/* Force all .border-primary to use Theme 13 */
.border-primary {
    border-color: var(--tm-primary) !important;
}

/* Force all badges to use Theme 13 */
.badge.bg-primary,
.badge-primary {
    background-color: var(--tm-primary) !important;
    color: #ffffff !important;
}

/* Force all alerts to use Theme 13 */
.alert-primary {
    background-color: rgba(26, 115, 232, 0.1) !important;
    border-color: rgba(26, 115, 232, 0.2) !important;
    color: var(--tm-primary) !important;
}

/* Force all list-group items to use Theme 13 */
.list-group-item-primary {
    background-color: rgba(26, 115, 232, 0.1) !important;
    color: var(--tm-primary) !important;
}

/* Force all table variants to use Theme 13 */
.table-primary {
    background-color: rgba(26, 115, 232, 0.1) !important;
    color: var(--tm-primary) !important;
}

/* Force progress bars to use Theme 13 */
.progress-bar {
    background-color: var(--tm-primary) !important;
}

/* Force pagination to use dark slate for links */
.pagination .page-link {
    color: #334155 !important;
}

.pagination .page-link:hover {
    background-color: var(--tm-bg-hover) !important;
    color: #1e293b !important;
}

.pagination .page-item.active .page-link {
    background-color: #334155 !important;
    border-color: #334155 !important;
}

/* Force nav pills to use dark slate */
.nav-pills .nav-link.active {
    background-color: #334155 !important;
}

/* Force breadcrumb active to use dark slate */
.breadcrumb-item.active {
    color: #334155 !important;
}

/* Force spinner to use Theme 13 */
.spinner-border-primary,
.spinner-grow-primary {
    color: var(--tm-primary) !important;
}

/* Override any remaining blue (Bootstrap default) */
.text-info,
.bg-info,
.btn-info,
.badge-info,
.alert-info {
    --bs-info: #3b82f6;
    --bs-info-rgb: 59, 130, 246;
}

/* ========================================
   NUCLEAR OPTION - Force #1a73e8 EVERYWHERE
   ======================================== */

/* Force every single primary button variant */
.btn-primary,
.btn.btn-primary,
a.btn.btn-primary,
button.btn-primary,
input[type="submit"].btn-primary,
input[type="button"].btn-primary {
    background-color: #1a73e8 !important;
    border-color: #1a73e8 !important;
    color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn.btn-primary:hover,
.btn.btn-primary:focus,
.btn.btn-primary:active {
    background-color: #1557b0 !important;
    border-color: #1557b0 !important;
    color: #ffffff !important;
}

/* Force primary backgrounds */
.bg-primary,
div.bg-primary,
span.bg-primary {
    background-color: #1a73e8 !important;
}

/* Force primary text - Links use dark slate, other elements use blue */
a.text-primary {
    color: #334155 !important;
}

.text-primary:not(a),
span.text-primary,
p.text-primary,
h1.text-primary,
h2.text-primary,
h3.text-primary,
h4.text-primary,
h5.text-primary,
h6.text-primary {
    color: #1a73e8 !important;
}

/* Force primary borders */
.border-primary,
.border-primary-subtle {
    border-color: #1a73e8 !important;
}

/* Force all links to use dark slate color */
a:not(.btn):not(.nav-link):not(.dropdown-item):not(.filter-chip):not(.page-link) {
    color: #334155 !important;
}

a:not(.btn):not(.nav-link):not(.dropdown-item):not(.filter-chip):not(.page-link):hover {
    color: #1e293b !important;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    body {
        background-color: #ffffff;
    }

    .card {
        box-shadow: none;
        border: 1px solid var(--tm-border);
    }

    a {
        text-decoration: underline;
    }
}


.category-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}