/* Coffee Fortune AI - Custom Styles */

/* Bootstrap-Tailwind Compatibility Layer */
/* Let Bootstrap handle container sizing */
.container-tw {
    width: 100%;
    padding-right: 1rem;
    padding-left: 1rem;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 640px) {
    .container-tw { max-width: 640px; }
}
@media (min-width: 768px) {
    .container-tw { max-width: 768px; }
}
@media (min-width: 1024px) {
    .container-tw { max-width: 1024px; }
}
@media (min-width: 1280px) {
    .container-tw { max-width: 1280px; }
}

/* Blazor Error UI - Hide by default */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

:root {
    /* High contrast color scheme for better visibility */
    --primary-color: #2C3E50;
    --secondary-color: #E74C3C;
    --success-color: #27AE60;
    --info-color: #3498DB;
    --warning-color: #F39C12;
    --danger-color: #C0392B;
    --light-color: #FFFFFF;
    --dark-color: #1A1A1A;
    --button-primary: #3498DB;
    --button-primary-hover: #2980B9;
    --button-secondary: #95A5A6;
    --button-secondary-hover: #7F8C8D;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--dark-color);
    line-height: 1.6;
    background-color: #f5f6fa;
    margin: 0;
    padding: 0;
}

/* Bootstrap Overrides - Enhanced for visibility and accessibility */
.btn-primary {
    background-color: var(--button-primary);
    border: 2px solid var(--button-primary);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-decoration: none;
    letter-spacing: 0.025em;
    min-height: 44px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--button-primary-hover);
    border-color: var(--button-primary-hover);
    color: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-secondary {
    background-color: #6b7280;
    border-color: #6b7280;
    color: white;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: #4b5563;
    border-color: #4b5563;
    color: white;
}

.btn-outline-primary {
    color: #f59e0b !important;
    border-color: #f59e0b !important;
    background-color: transparent !important;
}

.btn-outline-primary:hover {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: white !important;
}

.btn-danger {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
    color: white !important;
}

.btn-outline-danger {
    color: #ef4444 !important;
    border-color: #ef4444 !important;
    background-color: transparent !important;
}

.btn-outline-danger:hover {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
    color: white !important;
}

.btn {
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    border: 2px solid transparent;
    font-size: 1rem;
    line-height: 1.5;
    cursor: pointer;
    position: relative;
    z-index: 1;
    min-width: 120px;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

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

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

/* Navigation */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
    background-color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.navbar-brand:hover {
    color: #5a52d5 !important;
}

/* Desktop Navigation Links */
.nav-link {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
}

.nav-link:hover {
    color: #f59e0b;
    background-color: #fef3c7;
}

/* Compact Navigation Links (Icon Only) */
.nav-link-compact {
    padding: 0.5rem;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.nav-link-compact:hover {
    color: #f59e0b;
    background-color: #fef3c7;
}

.nav-link-compact i {
    font-size: 1.1rem;
}

/* Mobile Navigation Links */
.mobile-nav-link {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    text-align: left;
}

.mobile-nav-link:hover {
    background-color: #f3f4f6;
    color: #f59e0b;
}

/* Logout Button */
.btn-logout {
    padding: 0.5rem 1rem;
    background-color: #ef4444;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.btn-logout:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Dropdown Menu Links */
.dropdown-link {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: left;
}

.dropdown-link:hover {
    background-color: #fef3c7;
    color: #f59e0b;
}

/* Cards */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

/* Forms */
.form-control, .form-select {
    border-radius: 0.5rem;
    border: 1px solid #e0e6ed;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(108, 99, 255, 0.25);
}

.form-label {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Loading States */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50vh;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: 1rem;
}

.modal-header {
    border-bottom: 1px solid #e0e6ed;
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e0e6ed;
    padding: 1.5rem;
}

/* Tables */
.table {
    background-color: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
}

.table thead th {
    background-color: var(--light-color);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

/* Badges */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
    border-radius: 0.375rem;
}

/* Mobile Responsive - Enhanced for mobile-first */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .card {
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }
    
    .btn:not(.btn-sm):not(.navbar-toggler):not(.btn-group .btn) {
        width: 100%;
        margin-bottom: 0.5rem;
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    /* Better spacing on mobile */
    .container, .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Larger touch targets on mobile */
    a, button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better form inputs on mobile */
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 1rem;
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Utility Classes */
.shadow-sm {
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
}

.shadow {
    box-shadow: 0 4px 6px rgba(0,0,0,.1);
}

.shadow-lg {
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
}

.rounded {
    border-radius: 0.5rem !important;
}

.rounded-lg {
    border-radius: 1rem !important;
}

/* Custom Components */
.feature-icon {
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.section-subtitle {
    font-size: 1.125rem;
    color: #6c757d;
    margin-bottom: 3rem;
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1050;
    min-width: 300px;
    max-width: 400px;
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 3rem 0 2rem;
    margin-top: 5rem;
}

footer a {
    color: #a8b2c1;
    text-decoration: none;
}

footer a:hover {
    color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Additional button visibility fixes */
.btn:not(:disabled):not(.disabled) {
    cursor: pointer;
}

/* Ensure all buttons are visible */
button, [type="button"], [type="submit"], [type="reset"] {
    -webkit-appearance: button;
    appearance: button;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border-width: 3px !important;
    }
    
    .btn-primary {
        background-color: #0056b3 !important;
        border-color: #0056b3 !important;
    }
    
    .btn-secondary {
        background-color: #545454 !important;
        border-color: #545454 !important;
    }
}

/* Force button visibility in all states */
.btn, .btn:link, .btn:visited {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
}