/* 
 * StirCraft Base CSS
 * Contains styles for reusable components, partials, and global styling
 */

/* Import color variables first */
@import url('variables.css');

/* =============================================================================
 * 🎨 GLOBAL STYLES - HIGH CONTRAST WITH SPEAKEASY TYPOGRAPHY
 * ============================================================================= */

body {
    background-color: var(--bg-white);
    color: var(--text-primary);
    font-family: var(--font-family-body);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    font-weight: var(--font-weight-normal);
}

/* Typography hierarchy with speakeasy fonts */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
}

h1 {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: 1.5rem;
}

h2 {
    font-size: var(--font-size-3xl);
    margin-bottom: 1.25rem;
}

h3 {
    font-size: var(--font-size-2xl);
    margin-bottom: 1rem;
}

h4 {
    font-size: var(--font-size-xl);
    margin-bottom: 0.875rem;
}

h5 {
    font-size: var(--font-size-lg);
    margin-bottom: 0.75rem;
}

h6 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    margin-bottom: 0.5rem;
}

/* Brand typography for special elements */
.brand-text {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-medium);
    font-style: italic;
}

/* System font for UI elements */
.ui-text {
    font-family: var(--font-family-system);
}

/* Special typography for cocktail names and speakeasy elements */
.cocktail-name {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-semibold);
    font-style: italic;
    letter-spacing: 0.5px;
}

.menu-title {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.recipe-instructions {
    font-family: var(--font-family-body);
    font-style: italic;
    line-height: var(--line-height-relaxed);
}

.ingredient-list {
    font-family: var(--font-family-body);
    font-weight: var(--font-weight-normal);
}

/* Enhance readability for long text */
.readable-text {
    font-family: var(--font-family-body);
    line-height: var(--line-height-relaxed);
    font-size: var(--font-size-lg);
}

/* Card styling for maximum contrast */
.card {
    border: 2px solid var(--card-border);
    box-shadow: var(--card-shadow);
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
    background-color: var(--card-bg);
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.card-header {
    background-color: var(--card-header-bg) !important;
    color: var(--text-on-primary) !important;
    border-bottom: 2px solid var(--primary-dark) !important;
    font-family: var(--font-family-heading) !important;
    font-weight: var(--font-weight-semibold) !important;
    font-size: var(--font-size-lg) !important;
}

/* Navigation bar - High contrast with speakeasy typography */
.navbar-stircraft {
    background-color: var(--primary-color) !important;
    border-bottom: 3px solid var(--secondary-color);
}

.navbar-stircraft .navbar-brand {
    color: var(--text-on-primary) !important;
    font-family: var(--font-family-heading) !important;
    font-weight: var(--font-weight-bold) !important;
    font-size: var(--font-size-xl) !important;
    font-style: italic;
}

.navbar-stircraft .nav-link {
    color: var(--text-on-primary) !important;
    font-family: var(--font-family-body) !important;
    font-weight: var(--font-weight-medium) !important;
    font-size: var(--font-size-base) !important;
}

.navbar-stircraft .nav-link:hover,
.navbar-stircraft .nav-link:focus {
    color: var(--secondary-color) !important;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
}

.navbar-stircraft .navbar-toggler {
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.navbar-stircraft .navbar-toggler-icon {
    filter: invert(1) brightness(1.2);
}

/* =============================================================================
 * 🌈 GRADIENT STYLES
 * ============================================================================= */

.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
}

/* =============================================================================
 * 👤 PROFILE COMPONENTS
 * ============================================================================= */

.profile-avatar {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar i {
    font-size: 24px;
}

/* =============================================================================
 * 🍹 COCKTAIL CARD COMPONENTS
 * ============================================================================= */

.cocktail-card {
    border: 0;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.cocktail-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

.cocktail-card .card-body {
    padding: 1rem;
}

.cocktail-card .card-title {
    margin-bottom: 0.5rem;
}

.cocktail-card .card-title a {
    color: inherit;
    text-decoration: none;
}

.cocktail-card .card-title a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* =============================================================================
 * 📋 LIST ITEM COMPONENTS
 * ============================================================================= */

.list-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
}

.list-item:not(:last-child) {
    border-bottom: 1px solid var(--border-subtle);
}

.list-item-icon {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 0.5rem;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.list-item-content {
    flex: 1;
}

.list-item-meta {
    margin-left: auto;
}

/* =============================================================================
 * 🚫 EMPTY STATE COMPONENTS
 * ============================================================================= */

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.empty-state h6 {
    margin-top: 1rem;
    color: var(--text-secondary);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* =============================================================================
 * ⚡ QUICK ACTIONS COMPONENTS
 * ============================================================================= */

.quick-action-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 120px;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.quick-action-btn:hover {
    transform: translateY(-2px);
}

.quick-action-btn i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

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

.quick-action-btn:disabled:hover {
    transform: none;
}

/* =============================================================================
 * 🔒 LOCKED ELEMENT STYLES
 * ============================================================================= */

.locked-indicator {
    opacity: 0.7;
    cursor: help;
}

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

.btn-locked:disabled {
    pointer-events: auto;
}

/* =============================================================================
 * 📱 RESPONSIVE UTILITIES
 * ============================================================================= */

@media (max-width: 768px) {
    .profile-avatar {
        width: 50px;
        height: 50px;
    }
    
    .profile-avatar i {
        font-size: 20px;
    }
    
    .quick-action-btn {
        min-height: 100px;
    }
    
    .quick-action-btn i {
        font-size: 1.5rem;
    }
}

/* =============================================================================
 * 💳 ALERT SYSTEM - HIGH CONTRAST
 * ============================================================================= */

.alert {
    border: 2px solid;
    border-radius: var(--border-radius);
    font-weight: 500;
    margin-bottom: 1rem;
}

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

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

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

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

/* =============================================================================
 * 🎯 ACCESSIBILITY & RESPONSIVENESS
 * ============================================================================= */

/* Focus styles for keyboard navigation */
*:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Skip link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: var(--text-on-primary);
    padding: 8px;
    z-index: 1000;
    text-decoration: none;
    border-radius: var(--border-radius);
}

.skip-link:focus {
    top: 6px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .btn, .form-control, .nav-link, .dropdown-item {
        min-height: 44px;
        font-size: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .navbar-stircraft .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
}

/* Print styles */
@media print {
    .navbar, .btn, .dropdown {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}
/* =============================================================================
 * 🍸 COCKTAIL FORM STYLES (moved from template: stir_craft/templates/stir_craft/cocktail_create.html)
 * ============================================================================= */
.ingredient-formset {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    background-color: var(--bg-light);
}

/* Improved ingredient row for better readability */
.ingredient-row {
    display: grid;
    grid-template-columns: 4fr 2fr 2fr 3fr 1fr auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
}

.ingredient-row:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

/* Form input styling within ingredient rows */
.ingredient-row select,
.ingredient-row input {
    width: 100%;
    min-width: 0; /* Prevents overflow in grid */
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.ingredient-row select:focus,
.ingredient-row input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem var(--primary-alpha-05);
    outline: none;
}

/* Specific styling for ingredient dropdown */
.ingredient-row select[name*="ingredient"] {
    min-width: 180px; /* Ensure ingredient dropdown is readable */
}

/* Amount and unit fields */
.ingredient-row input[name*="amount"] {
    min-width: 80px;
    text-align: center;
}

.ingredient-row select[name*="unit"] {
    min-width: 100px;
}

/* Preparation notes field */
.ingredient-row input[name*="preparation_note"] {
    min-width: 120px;
}

/* Order field */
.ingredient-row input[name*="order"] {
    min-width: 60px;
    text-align: center;
}

.delete-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.delete-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.add-ingredient-btn {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
}

/* Enhanced header row styling */
.ingredient-formset-header {
    display: grid;
    grid-template-columns: 4fr 2fr 2fr 3fr 1fr auto;
    gap: 1rem;
    background-color: var(--bg-gray-100);
    padding: 0.75rem 1rem;
    margin: 0 0 1rem 0;
    border-radius: var(--border-radius);
    font-weight: 600;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.ingredient-formset .row.mb-2 {
    background-color: var(--bg-gray-100);
    padding: 0.75rem 1rem;
    margin: 0 0 1rem 0;
    border-radius: var(--border-radius);
    font-weight: 600;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

/* Responsive design for smaller screens */
@media (max-width: 992px) {
    .ingredient-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .ingredient-row > div {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .ingredient-row > div::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.85rem;
        color: var(--text-secondary);
        margin-bottom: 0.25rem;
    }
    
    /* Hide the header rows on small screens since we show labels inline */
    .ingredient-formset-header,
    .ingredient-formset .row.mb-2 {
        display: none !important;
    }
    
    .ingredient-row select,
    .ingredient-row input {
        min-width: auto;
        width: 100%;
    }
    
    .delete-checkbox {
        justify-content: flex-start;
        margin-top: 0.5rem;
    }
}

@media (max-width: 768px) {
    .ingredient-formset {
        padding: 1rem;
    }
    
    .ingredient-row {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .ingredient-row select,
    .ingredient-row input {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}

.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--bg-gray-200);
    border-radius: var(--border-radius-lg);
    background-color: var(--bg-white);
}

.section-title {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Home hero partial logo styling (moved from template partials/_home_hero.html) */
.home-hero-logo {
    max-height: 260px;
    object-fit: contain;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.border-start-primary {
    border-left: 3px solid var(--bs-primary);
}

.border-start-success {
    border-left: 3px solid var(--bs-success);
}

.border-start-danger {
    border-left: 3px solid var(--bs-danger);
}

.border-start-info {
    border-left: 3px solid var(--bs-info);
}

/* =============================================================================
 * 🔘 BUTTON SYSTEM - HIGH CONTRAST
 * ============================================================================= */

/* Primary buttons with speakeasy typography */
.btn-primary {
    background-color: var(--btn-primary-bg) !important;
    color: var(--btn-primary-text) !important;
    border: 2px solid var(--btn-primary-border) !important;
    font-family: var(--font-family-body) !important;
    font-weight: var(--font-weight-semibold) !important;
    font-size: var(--font-size-base) !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all var(--transition-fast) !important;
    letter-spacing: 0.5px !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--btn-primary-hover-bg) !important;
    color: var(--btn-primary-text) !important;
    border-color: var(--btn-primary-hover-border) !important;
    box-shadow: var(--shadow-md) !important;
    transform: translateY(-1px) !important;
}

/* Secondary buttons with speakeasy typography */
.btn-secondary {
    background-color: var(--btn-secondary-bg) !important;
    color: var(--btn-secondary-text) !important;
    border: 2px solid var(--btn-secondary-border) !important;
    font-family: var(--font-family-body) !important;
    font-weight: var(--font-weight-semibold) !important;
    font-size: var(--font-size-base) !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all var(--transition-fast) !important;
    letter-spacing: 0.5px !important;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--btn-secondary-hover-bg) !important;
    color: var(--btn-secondary-text) !important;
    border-color: var(--btn-secondary-border) !important;
    box-shadow: var(--shadow-md) !important;
    transform: translateY(-1px) !important;
}

/* Outline buttons */
.btn-outline-primary,
.btn-outline-secondary {
    background-color: var(--btn-outline-bg) !important;
    color: var(--btn-outline-text) !important;
    border: 2px solid var(--btn-outline-border) !important;
    font-weight: 600 !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all var(--transition-fast) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background-color: var(--btn-outline-hover-bg) !important;
    color: var(--btn-outline-hover-text) !important;
    border-color: var(--btn-outline-border) !important;
    box-shadow: var(--shadow-md) !important;
    transform: translateY(-1px) !important;
}

/* Generic button styling */
.btn {
    min-height: 44px; /* WCAG accessibility requirement */
    font-weight: 600;
    letter-spacing: 0.025em;
    transition: all var(--transition-fast);
}

.btn:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* =============================================================================
 * 📝 FORM CONTROLS - HIGH CONTRAST
 * ============================================================================= */

.form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--bg-white);
    color: var(--text-primary);
    min-height: 44px; /* WCAG accessibility requirement */
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(75, 44, 59, 0.25);
    outline: none;
}

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

/* =============================================================================
 * 🏷️ BADGE AND TAG SYSTEM - HIGH CONTRAST
 * ============================================================================= */

.badge {
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    border: 1px solid transparent;
}

.badge.bg-primary {
    background-color: var(--primary-color) !important;
    color: var(--text-on-primary) !important;
    border-color: var(--primary-dark) !important;
}

.badge.bg-secondary {
    background-color: var(--secondary-color) !important;
    color: var(--text-on-primary) !important;
    border-color: var(--secondary-dark) !important;
}

/* =============================================================================
 * 📋 DROPDOWN SYSTEM - HIGH CONTRAST
 * ============================================================================= */

.dropdown-menu {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    background-color: var(--bg-white);
}

.dropdown-item {
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: background-color var(--transition-fast);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--bg-gray-100);
    color: var(--text-primary);
}

.dropdown-divider {
    border-top: 1px solid var(--border-color);
}

/* =============================================================================
 * 🎯 TEXT AND BACKGROUND UTILITIES - HIGH CONTRAST
 * ============================================================================= */

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

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

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

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

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

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

/* =============================================================================
 * 🔗 LINK SYSTEM - HIGH CONTRAST
 * ============================================================================= */

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

a:hover,
a:focus {
    color: var(--primary-dark);
    text-decoration: underline;
}

.text-decoration-none:hover {
    text-decoration: underline !important;
}
