/* 
 * Stanleypot - Unified Site Theme
 * Dark high-contrast theme inspired by the blog design
 */

/* Root Variables for Consistent Theming */
:root {
    /* Primary Color Palette */
    --primary-purple: #7b2cbf;
    --primary-purple-light: #9d4edd;
    --primary-purple-lighter: #c77dff;
    --primary-purple-lightest: #e0aaff;
    
    /* Background Colors */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d1b69;
    --bg-card: #2a2a2a;
    --bg-card-secondary: #1f1f1f;
    --bg-input: #333;
    --bg-input-focus: #3a3a3a;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #e8e8e8;
    --text-muted: #999;
    --text-link: #c77dff;
    --text-link-hover: #e0aaff;
    --text-form-label: #2c3e50;
    --text-form-label-light: #1a252f;
    
    /* Border Colors */
    --border-primary: #444;
    --border-secondary: #555;
    --border-accent: #7b2cbf;
    
    /* Status Colors */
    --success: #51cf66;
    --success-bg: rgba(25, 135, 84, 0.1);
    --warning: #ffb84d;
    --warning-bg: rgba(253, 126, 20, 0.1);
    --danger: #ff6b6b;
    --danger-bg: rgba(220, 53, 69, 0.1);
    --info: #66e7ff;
    --info-bg: rgba(13, 202, 240, 0.1);
    
    /* Shadow Colors */
    --shadow-primary: rgba(0, 0, 0, 0.3);
    --shadow-purple: rgba(123, 44, 191, 0.3);
    --shadow-purple-strong: rgba(123, 44, 191, 0.4);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #1a1a1a 0%, #2d1b69 100%);
    --gradient-card: linear-gradient(145deg, #2a2a2a, #1f1f1f);
    --gradient-header: linear-gradient(90deg, #2d1b69 0%, #7b2cbf 100%);
    --gradient-button: linear-gradient(45deg, #7b2cbf, #9d4edd);
    --gradient-button-hover: linear-gradient(45deg, #9d4edd, #c77dff);
    
    /* Font Size Variables - Increased globally */
    --font-size-base: 18px; /* Increased from default 16px */
    --font-size-sm: 16px;   /* Increased from default 14px */
    --font-size-lg: 22px;   /* Increased from default 20px */
    --font-size-xl: 26px;   /* Increased from default 24px */
}

/* Base Styles Override */
html {
    font-size: var(--font-size-base); /* Sets root font size to 18px */
}

body {
    background: var(--gradient-primary) !important;
    color: var(--text-secondary) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    min-height: 100vh;
    line-height: 1.6;
    font-size: var(--font-size-base); /* Explicitly set body font size */
}

/* Typography - Enhanced Font Sizes */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary) !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    font-weight: 600;
}

h1 {
    font-size: 2.75rem; /* Increased from ~2.5rem */
}

h2 {
    font-size: 2.25rem; /* Increased from ~2rem */
}

h3 {
    font-size: 1.875rem; /* Increased from ~1.75rem */
}

h4 {
    font-size: 1.625rem; /* Increased from ~1.5rem */
}

h5 {
    font-size: 1.375rem; /* Increased from ~1.25rem */
}

h6 {
    font-size: 1.125rem; /* Increased from ~1rem */
}

p {
    color: var(--text-secondary);
    font-size: var(--font-size-base); /* Explicitly set paragraph font size */
}

.lead {
    font-size: 1.375rem; /* Increased from ~1.25rem */
}

.display-1 {
    font-size: 6.5rem; /* Increased from ~6rem */
}

.display-2 {
    font-size: 5.75rem; /* Increased from ~5.5rem */
}

.display-3 {
    font-size: 5rem; /* Increased from ~4.5rem */
}

.display-4 {
    font-size: 4rem; /* Increased from ~3.5rem */
}

.display-5 {
    font-size: 3.25rem; /* Increased from ~3rem */
}

.display-6 {
    font-size: 2.75rem; /* Increased from ~2.5rem */
}

.small, small {
    font-size: var(--font-size-sm); /* Increased from ~0.875rem */
}

a {
    color: var(--text-link) !important;
    text-decoration: none !important;
    transition: color 0.3s ease;
    font-size: inherit; /* Inherit larger font sizes */
}

a:hover {
    color: var(--text-link-hover) !important;
}

/* Navigation Bar Override - Increased Font Sizes */
.navbar {
    background: var(--gradient-header) !important;
    border-bottom: 2px solid var(--border-accent) !important;
    box-shadow: 0 4px 20px var(--shadow-purple);
    margin-bottom: 0 !important;
}

.navbar-brand {
    color: var(--text-primary) !important;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-size: 1.375rem; /* Increased from ~1.25rem */
}

.navbar-brand:hover {
    color: var(--text-primary) !important;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 0 0.25rem;
    border-radius: 4px;
    padding: 0.5rem 1rem !important;
    font-size: 1.125rem; /* Increased from ~1rem */
}

.navbar-nav .nav-link:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.15);
}

/* Dropdown Menu - Increased Font Sizes */
.dropdown-menu {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    border-radius: 8px;
    box-shadow: 0 8px 32px var(--shadow-primary);
}

.dropdown-item {
    color: var(--text-secondary) !important;
    transition: all 0.3s ease;
    font-size: 1.0625rem; /* Increased from ~1rem */
    padding: 0.625rem 1.25rem; /* Increased padding for larger text */
}

.dropdown-item:hover {
    background: var(--gradient-button) !important;
    color: var(--text-primary) !important;
}

.dropdown-divider {
    border-color: var(--border-primary) !important;
}

/* Main Content Container */
.container, .container-fluid {
    background: transparent;
}

main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Cards - Enhanced Typography */
.card {
    background: var(--gradient-card) !important;
    border: 1px solid var(--border-primary) !important;
    border-radius: 12px;
    box-shadow: 0 8px 32px var(--shadow-primary);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px var(--shadow-purple);
}

.card-header {
    background: var(--gradient-header) !important;
    border-bottom: 2px solid var(--border-accent) !important;
    color: var(--text-primary) !important;
    font-weight: 600;
    border-radius: 12px 12px 0 0 !important;
    font-size: 1.1875rem; /* Increased from ~1.125rem */
}

.card-body {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
}

.card-title {
    color: var(--text-primary) !important;
    font-size: 1.25rem; /* Increased from ~1.125rem */
}

.card-text {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
}

/* Tables - Increased Font Sizes */
.table {
    background: rgba(42, 42, 42, 0.9) !important;
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px var(--shadow-primary);
    color: var(--text-secondary) !important;
    font-size: 1.0625rem; /* Increased from ~1rem */
}

.table thead th {
    background: var(--gradient-header) !important;
    color: var(--text-primary) !important;
    border-bottom: 2px solid var(--border-accent) !important;
    font-weight: 600;
    padding: 1rem;
    border-color: var(--border-secondary) !important;
    font-size: 1.125rem; /* Increased from ~1rem */
}

.table tbody td {
    background: rgba(51, 51, 51, 0.8);
    color: var(--text-secondary) !important;
    border-color: var(--border-secondary) !important;
    padding: 1rem;
    vertical-align: middle;
    font-size: 1.0625rem; /* Increased from ~1rem */
}

.table tbody tr:nth-child(even) td {
    background: rgba(58, 58, 58, 0.8);
}

.table tbody tr:hover td {
    background: rgba(123, 44, 191, 0.1) !important;
    color: var(--text-primary) !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background: rgba(70, 70, 70, 0.4) !important;
}

.table-striped > tbody > tr:nth-of-type(even) > td {
    background: rgba(58, 58, 58, 0.6) !important;
}

.table-hover > tbody > tr:hover > td {
    background: rgba(123, 44, 191, 0.15) !important;
}

.table-dark {
    background: var(--gradient-header) !important;
}

/* Forms - Enhanced for Better Contrast and Font Sizes */
.form-label {
    color: var(--text-form-label) !important;
    font-weight: 700 !important;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8) !important;
    font-size: 1.0625rem; /* Increased from ~1rem */
}

/* Form labels on light backgrounds (like modal/card bodies) */
.modal-body .form-label,
.card-body .form-label,
.bg-light .form-label,
.bg-white .form-label {
    color: var(--text-form-label-light) !important;
    font-weight: 700 !important;
    text-shadow: none !important;
}

/* Form labels on dark backgrounds */
.bg-dark .form-label,
.navbar .form-label,
.card-header .form-label {
    color: var(--text-primary) !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5) !important;
}

/* Enhanced form control styling */
.form-control, .form-select {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid var(--border-secondary) !important;
    color: #2c3e50 !important;
    border-radius: 8px;
    padding: 0.75rem;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 1.0625rem; /* Increased from ~1rem */
}

.form-control:focus, .form-select:focus {
    background: #ffffff !important;
    border-color: var(--border-accent) !important;
    color: #1a252f !important;
    box-shadow: 0 0 0 0.2rem rgba(123, 44, 191, 0.25) !important;
    outline: none;
}

.form-control::placeholder {
    color: #6c757d !important;
    opacity: 0.7;
    font-size: 1rem; /* Slightly smaller than input text */
}

.form-control:disabled, .form-select:disabled {
    background: #f8f9fa !important;
    color: #6c757d !important;
    border-color: #dee2e6 !important;
    opacity: 0.8;
}

/* Form text and help text */
.form-text {
    color: var(--text-muted) !important;
    font-size: 1rem; /* Increased from ~0.875rem */
}

/* Form validation states */
.is-valid {
    border-color: #198754 !important;
}

.is-invalid {
    border-color: #dc3545 !important;
}

.valid-feedback {
    color: #198754 !important;
    font-weight: 500;
    font-size: 1rem; /* Increased from ~0.875rem */
}

.invalid-feedback {
    color: #dc3545 !important;
    font-weight: 500;
    font-size: 1rem; /* Increased from ~0.875rem */
}

/* Input groups */
.input-group-text {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 2px solid var(--border-secondary) !important;
    color: var(--text-form-label) !important;
    font-weight: 600;
    font-size: 1.0625rem; /* Increased from ~1rem */
}

/* Checkboxes and radios */
.form-check-label {
    color: var(--text-form-label) !important;
    font-weight: 600 !important;
    font-size: 1.0625rem; /* Increased from ~1rem */
}

.form-check-input:checked {
    background-color: var(--primary-purple) !important;
    border-color: var(--primary-purple) !important;
}

/* Buttons - Increased Font Sizes */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.75rem 1.375rem; /* Increased padding for larger text */
    transition: all 0.3s ease;
    border: none;
    text-decoration: none !important;
    font-size: 1.0625rem; /* Increased from ~1rem */
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 1rem; /* Increased from ~0.875rem */
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.25rem; /* Increased from ~1.125rem */
}

.btn-primary {
    background: var(--gradient-button) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 2px 8px var(--shadow-purple);
    border: none !important;
}

.btn-primary:hover {
    background: var(--gradient-button-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-purple-strong);
    color: var(--text-primary) !important;
}

.btn-secondary {
    background: linear-gradient(45deg, #495057, #6c757d) !important;
    color: var(--text-primary) !important;
    border: none !important;
}

.btn-secondary:hover {
    background: linear-gradient(45deg, #6c757d, #868e96) !important;
    transform: translateY(-2px);
    color: var(--text-primary) !important;
}

.btn-success {
    background: linear-gradient(45deg, #198754, #20c997) !important;
    color: var(--text-primary) !important;
    border: none !important;
}

.btn-success:hover {
    background: linear-gradient(45deg, #20c997, var(--success)) !important;
    transform: translateY(-2px);
    color: var(--text-primary) !important;
}

.btn-danger {
    background: linear-gradient(45deg, #dc3545, #e55353) !important;
    color: var(--text-primary) !important;
    border: none !important;
}

.btn-danger:hover {
    background: linear-gradient(45deg, #e55353, var(--danger)) !important;
    transform: translateY(-2px);
    color: var(--text-primary) !important;
}

.btn-warning {
    background: linear-gradient(45deg, #fd7e14, #ff922b) !important;
    color: var(--text-primary) !important;
    border: none !important;
}

.btn-warning:hover {
    background: linear-gradient(45deg, #ff922b, var(--warning)) !important;
    transform: translateY(-2px);
    color: var(--text-primary) !important;
}

.btn-info {
    background: linear-gradient(45deg, #0dcaf0, #31d2f2) !important;
    color: var(--text-primary) !important;
    border: none !important;
}

.btn-info:hover {
    background: linear-gradient(45deg, #31d2f2, var(--info)) !important;
    transform: translateY(-2px);
    color: var(--text-primary) !important;
}

/* Alert Components - Increased Font Sizes */
.alert {
    border-radius: 8px;
    border: none;
    border-left: 4px solid;
    margin-bottom: 1rem;
    font-size: 1.0625rem; /* Increased from ~1rem */
    padding: 1rem 1.25rem; /* Increased padding */
}

.alert-warning {
    background: var(--warning-bg) !important;
    border-left-color: #fd7e14 !important;
    color: var(--warning) !important;
}

.alert-success {
    background: var(--success-bg) !important;
    border-left-color: #198754 !important;
    color: var(--success) !important;
}

.alert-danger {
    background: var(--danger-bg) !important;
    border-left-color: #dc3545 !important;
    color: var(--danger) !important;
}

.alert-info {
    background: var(--info-bg) !important;
    border-left-color: #0dcaf0 !important;
    color: var(--info) !important;
}

/* Badges - Increased Font Sizes */
.badge {
    border-radius: 12px;
    padding: 0.6rem 0.875rem; /* Increased padding */
    font-weight: 500;
    font-size: 0.9375rem; /* Increased from ~0.875rem */
}

.bg-success {
    background: linear-gradient(45deg, #198754, #20c997) !important;
}

.bg-danger {
    background: linear-gradient(45deg, #dc3545, #e55353) !important;
}

.bg-warning {
    background: linear-gradient(45deg, #fd7e14, #ff922b) !important;
}

.bg-secondary {
    background: linear-gradient(45deg, #495057, #6c757d) !important;
}

.bg-info {
    background: linear-gradient(45deg, #0dcaf0, #31d2f2) !important;
}

.bg-primary {
    background: var(--gradient-button) !important;
}

/* Text Color Utilities */
.text-primary {
    color: var(--primary-purple-lighter) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-info {
    color: var(--info) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-white {
    color: var(--text-primary) !important;
}

.text-light {
    color: var(--text-secondary) !important;
}

.text-dark {
    color: var(--text-primary) !important;
}

/* Footer - Increased Font Size */
.footer {
    background: var(--gradient-header) !important;
    border-top: 2px solid var(--border-accent) !important;
    color: var(--text-secondary) !important;
    padding: 1.5rem 0;
    margin-top: auto;
    font-size: 1.0625rem; /* Increased from ~1rem */
}

.footer a {
    color: var(--text-link) !important;
}

.footer a:hover {
    color: var(--text-link-hover) !important;
}

/* Pagination - Increased Font Sizes */
.pagination .page-link {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    color: var(--text-secondary) !important;
    font-size: 1.0625rem; /* Increased from ~1rem */
    padding: 0.75rem 1rem; /* Increased padding */
}

.pagination .page-link:hover {
    background: var(--gradient-button) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-accent) !important;
}

.pagination .page-item.active .page-link {
    background: var(--gradient-button) !important;
    border-color: var(--border-accent) !important;
    color: var(--text-primary) !important;
}

/* Modal - Increased Font Sizes */
.modal-content {
    background: var(--gradient-card) !important;
    border: 1px solid var(--border-primary) !important;
    border-radius: 12px;
}

.modal-header {
    background: var(--gradient-header) !important;
    border-bottom: 2px solid var(--border-accent) !important;
    border-radius: 12px 12px 0 0 !important;
}

.modal-title {
    color: var(--text-primary) !important;
    font-size: 1.375rem; /* Increased from ~1.25rem */
}

.modal-body {
    color: var(--text-secondary) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 0 0 12px 12px;
    font-size: var(--font-size-base);
}

/* Lists - Increased Font Sizes */
.list-group-item {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    color: var(--text-secondary) !important;
    font-size: 1.0625rem; /* Increased from ~1rem */
    padding: 1rem 1.25rem; /* Increased padding */
}

.list-group-item:hover {
    background: rgba(123, 44, 191, 0.1) !important;
}

/* Progress Bars */
.progress {
    background: var(--bg-input) !important;
    border-radius: 8px;
}

.progress-bar {
    background: var(--gradient-button) !important;
}

/* Tooltips - Increased Font Size */
.tooltip .tooltip-inner {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-primary);
    font-size: 1rem; /* Increased from ~0.875rem */
    padding: 0.5rem 0.75rem; /* Increased padding */
}

/* Breadcrumb - Increased Font Size */
.breadcrumb {
    background: rgba(123, 44, 191, 0.1) !important;
    border-radius: 8px;
    padding: 0.875rem 1.125rem; /* Increased padding */
    font-size: 1.0625rem; /* Increased from ~1rem */
}

.breadcrumb-item a {
    color: var(--text-link) !important;
}

.breadcrumb-item.active {
    color: var(--text-secondary) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-input);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-button);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gradient-button-hover);
}

/* Responsive Design - Adjusted for Larger Base Font */
@media (max-width: 768px) {
    html {
        font-size: 16px; /* Slightly smaller on mobile but still larger than default 14px */
    }
    
    .navbar-nav {
        background: rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        margin-top: 1rem;
        padding: 0.5rem;
    }
    
    .table {
        font-size: 1rem; /* Smaller on mobile but still readable */
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        font-size: 1rem; /* Ensure buttons are readable on mobile */
    }
    
    main {
        padding: 1rem 0;
    }
    
    h1 {
        font-size: 2.25rem; /* Smaller on mobile */
    }
    
    h2 {
        font-size: 1.875rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
}

/* Loading States */
.spinner-border {
    color: var(--primary-purple) !important;
}

.spinner-grow {
    color: var(--primary-purple) !important;
}

/* Focus States */
*:focus {
    outline: none !important;
    box-shadow: 0 0 0 0.2rem rgba(123, 44, 191, 0.25) !important;
}

/* Selection */
::selection {
    background: var(--primary-purple-light);
    color: var(--text-primary);
}

::-moz-selection {
    background: var(--primary-purple-light);
    color: var(--text-primary);
}

/* Page-specific overrides for existing pages that shouldn't be themed */
body.home-page {
    background: transparent !important;
}

/* Don't theme the home page animations */
.animation-container,
.animation-container * {
    background: unset !important;
    color: unset !important;
}

/* Ensure admin and blog themes take precedence */
.admin-container,
.admin-container * {
    /* Admin styles will override these */
}

.blog-container,
.blog-container * {
    /* Blog styles will override these */
}