/* CellarSomm - Wine Collection Management App
 * Modern, sophisticated UI with burgundy color theme
 */

:root {
    /* Color Palette */
    --burgundy-dark: #5E1224;  
    --burgundy: #8C1C33;       
    --burgundy-light: #AA3E51;  
    --burgundy-lightest: #C87888;
    --wine-gold: #D4AF37;     
    --wine-gold-light: #F5E9C0;
    --wine-brown: #522F26;     
    --wine-gray: #F4F2F3;      
    --gray-dark: #343a40;
    --gray: #6c757d;
    --gray-light: #f8f9fa;
    --white: #ffffff;
    
    /* Font settings */
    --font-family-serif: 'Playfair Display', Georgia, serif;
    --font-family-sans: 'Raleway', 'Helvetica Neue', Arial, sans-serif;
}

/* Base Styles */
body {
    font-family: var(--font-family-sans);
    color: var(--gray-dark);
    background-color: var(--wine-gray);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-serif);
    font-weight: 600;
}

/* Custom Navbar */
.navbar {
    background-color: var(--burgundy-dark);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 1rem;
}

.navbar-brand {
    font-family: var(--font-family-serif);
    font-weight: 700;
    letter-spacing: 0.5px;
    font-size: 1.4rem;
}

.navbar-dark .navbar-brand {
    color: var(--white);
}

.navbar-dark .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    transition: color 0.3s ease, transform 0.2s ease;
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.navbar-dark .nav-link:hover,
.navbar-dark .nav-link:focus {
    color: var(--white) !important;
    transform: translateY(-2px);
}

.navbar-dark .nav-link.active {
    color: var(--wine-gold) !important;
    position: relative;
}

.navbar-dark .nav-link.active:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background-color: var(--wine-gold);
}

/* Custom Breadcrumb Navigation */
.wine-breadcrumb {
    display: flex;
    list-style: none;
    padding: 1rem 0;
    margin: 0 0 2rem 0;
    background-color: transparent;
    font-size: 0.9rem;
}

.wine-breadcrumb-item {
    display: flex;
    align-items: center;
}

.wine-breadcrumb-item:not(:first-child)::before {
    content: '/';
    padding: 0 0.75rem;
    color: var(--gray);
}

.wine-breadcrumb-item a {
    color: var(--burgundy);
    transition: color 0.2s, transform 0.2s;
    text-decoration: none;
}

.wine-breadcrumb-item a:hover {
    color: var(--burgundy-light);
    text-decoration: none;
    transform: translateY(-1px);
}

.wine-breadcrumb-item.active {
    color: var(--gray);
}

/* Cards with burgundy accents */
.card {
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.card-header {
    background-color: rgba(94, 18, 36, 0.03);
    border-bottom: 1px solid rgba(94, 18, 36, 0.1);
    font-weight: 600;
    padding: 1.25rem 1.5rem;
}

.card-title {
    font-family: var(--font-family-serif);
    color: var(--burgundy-dark);
    margin-bottom: 1rem;
}

.card-body {
    padding: 1.5rem;
}

/* Button Styles */
.btn {
    border-radius: 6px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.btn-primary {
    background-color: var(--burgundy);
    border-color: var(--burgundy);
}

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

.btn-outline-secondary:hover {
    background-color: var(--gray-light);
    color: var(--gray-dark);
    transform: translateY(-2px);
}

.btn-gold {
    background-color: var(--wine-gold);
    border-color: var(--wine-gold);
    color: var(--gray-dark);
}

.btn-gold:hover, .btn-gold:focus {
    background-color: #C59F32;
    border-color: #C59F32;
    color: var(--gray-dark);
    transform: translateY(-2px);
}

.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--white);
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--white);
    transform: translateY(-2px);
}

/* Form Controls with wine-themed focus states */
.form-control:focus {
    border-color: var(--burgundy-light);
    box-shadow: 0 0 0 0.2rem rgba(140, 28, 51, 0.25);
}

/* Form controls for better mobile experience */
.form-control {
    font-size: 16px; /* Prevents iOS zoom on focus */
    padding: 0.65rem 1rem;
    border-radius: 6px;
}

/* Improve touch targets */
.btn, .nav-link, .form-control, select, input, textarea {
    min-height: 44px; /* Apple's recommended touch target size */
}

/* Make checkboxes and radio buttons easier to tap */
.form-check {
    padding-left: 1.8rem;
}

.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    margin-left: -1.8rem;
}

/* Wine Badge Styles */
.badge.bg-primary {
    background-color: var(--burgundy) !important;
}

/* Wine Bottle Display */
.wine-bottle {
    height: 240px;
    background: linear-gradient(135deg, var(--burgundy-dark) 0%, var(--burgundy) 100%);
    border-radius: 12px 12px 0 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wine-bottle:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
}

/* Rating Display */
.rating-display {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background-color: var(--wine-gold-light);
    border-radius: 4px;
    color: var(--wine-brown);
    font-weight: 600;
}

.rating-display i {
    margin-right: 0.3rem;
    color: var(--wine-gold);
}

/* Animation for loading states */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s infinite;
}

.loading:after {
    content: "";
    border: 2px solid rgba(140, 28, 51, 0.2);
    border-top: 2px solid var(--burgundy);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    position: absolute;
    left: 50%;
    top: 50%;
    margin: -10px 0 0 -10px;
}

.loading:before {
    content: "";
    background-color: rgba(255, 255, 255, 0.8);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-dark .nav-link.active:after {
        width: 15px;
    }
    
    .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .btn {
        padding: 0.5rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .nav-link, .btn, .form-control {
        min-height: 40px;
    }
    
    .card {
        margin-bottom: 1.5rem;
    }
    
    .form-group {
        margin-bottom: 1.25rem;
    }
}

@media (max-width: 576px) {
    .wine-list-item {
        padding: 0.75rem;
    }
    
    .card-title {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }
    
    .row > [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .d-grid .btn, 
    .container .btn,
    .form-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        margin-right: 0 !important;
    }
    
    .dropdown-menu {
        width: 100%;
    }
    
    .mt-3 {
        margin-top: 1.5rem !important;
    }
    
    .mb-3 {
        margin-bottom: 1.5rem !important;
    }
    
    .wine-bottle {
        height: 180px;
    }
    
    .chat-container {
        max-height: 350px;
        overflow-y: auto;
    }
    
    input, select, textarea {
        font-size: 16px !important; /* Prevent iOS zoom */
    }
}

@media (max-width: 400px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .h1, h1 {
        font-size: 1.8rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
}

/* Wine List Item */
.wine-list-item {
    display: flex;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.wine-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Custom Alert Styles */
.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    border-color: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
}

/* Wine Label Image Styling */
.wine-label-thumbnail {
    object-fit: cover;
    object-position: center;
}

/* AI Suggestion Button */
#getAIDetails {
    background-color: var(--burgundy);
    border-color: var(--burgundy);
    color: white;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#getAIDetails:hover {
    background-color: var(--burgundy-light);
    border-color: var(--burgundy-light);
    box-shadow: 0 4px 8px rgba(128, 0, 32, 0.3);
}

/* Wine Assistant Chat */
.chat-message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 1rem;
}

.chat-message.user {
    background-color: rgba(94, 11, 21, 0.1);
    border-top-right-radius: 0;
    margin-left: 2rem;
}

.chat-message.assistant {
    background-color: #f8f9fa;
    border-top-left-radius: 0;
    margin-right: 2rem;
}

/* Wine Detail Page */
.wine-detail-header {
    background: linear-gradient(135deg, var(--burgundy-dark) 0%, var(--burgundy) 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.wine-detail-header h1 {
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.wine-detail-header .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Font imports */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Lato:wght@300;400;700&display=swap');
