/**
 * Wine Event Digital Order Book
 * Main Application Styles
 * 
 * Mobile-first responsive design
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --primary-colour: #8B0000;
    --secondary-colour: #FFD700;
    --success-colour: #28a745;
    --warning-colour: #ffc107;
    --danger-colour: #dc3545;
    --info-colour: #17a2b8;
    
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    
    --border-colour: #dee2e6;
    --border-radius: 0.75rem;
    --border-radius-sm: 0.5rem;
    --border-radius-lg: 1rem;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

/* ============================================
   Base Styles
   ============================================ */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-light);
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

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

/* ============================================
   Eco Standard Badges
   ============================================ */
.eco-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.eco-badge.gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
}

.eco-badge.silver {
    background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%);
    color: #000;
}

.eco-badge.bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #B8860B 100%);
    color: #fff;
}

.eco-badge.developing {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: #fff;
}

/* ============================================
   Wine Type Badges
   ============================================ */
.wine-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.wine-type-badge.red {
    background-color: #722F37;
    color: #fff;
}

.wine-type-badge.white {
    background-color: #F5F5DC;
    color: #333;
    border: 1px solid #ddd;
}

.wine-type-badge.rose {
    background-color: #FFB6C1;
    color: #333;
}

.wine-type-badge.sparkling {
    background-color: #E6E6FA;
    color: #333;
}

.wine-type-badge.dessert {
    background-color: #D2691E;
    color: #fff;
}

.wine-type-badge.fortified {
    background-color: #800020;
    color: #fff;
}

/* ============================================
   Wine Tags
   ============================================ */
.wine-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 500;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.wine-tag.vegan {
    background-color: #d4edda;
    color: #155724;
}

.wine-tag.organic {
    background-color: #d1ecf1;
    color: #0c5460;
}

.wine-tag.biodynamic {
    background-color: #e2d5f1;
    color: #4a235a;
}

.wine-tag i {
    margin-right: 0.25rem;
}

/* ============================================
   New Producer Badge
   ============================================ */
.new-badge {
    display: inline-block;
    background: var(--primary-colour);
    color: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* ============================================
   Info Table (Two Column)
   ============================================ */
.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table tr {
    border-bottom: 1px solid var(--border-colour);
}

.info-table tr:last-child {
    border-bottom: none;
}

.info-table th,
.info-table td {
    padding: 1rem;
    text-align: left;
    vertical-align: top;
}

.info-table th {
    width: 40%;
    font-weight: 600;
    color: var(--text-primary);
    background-color: #f8f9fa;
}

.info-table td {
    color: var(--text-secondary);
}

/* ============================================
   Floor Plan Key
   ============================================ */
.floorplan-key {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.floorplan-key-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.floorplan-key-colour {
    width: 24px;
    height: 24px;
    border-radius: 0.25rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* ============================================
   Seminar Cards
   ============================================ */
.seminar-card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.seminar-card .seminar-time {
    display: inline-block;
    background: var(--primary-colour);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.seminar-card .seminar-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.seminar-card .seminar-speaker {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.seminar-card .seminar-location {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.seminar-card .seminar-capacity {
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.seminar-card .capacity-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    margin-top: 0.25rem;
    overflow: hidden;
}

.seminar-card .capacity-bar .fill {
    height: 100%;
    background: var(--primary-colour);
    border-radius: 3px;
    transition: width var(--transition-normal);
}

/* ============================================
   News Cards
   ============================================ */
.news-card {
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.news-card .news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #f0f0f0;
}

.news-card .news-body {
    padding: 1.25rem;
}

.news-card .news-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.news-card .news-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.news-card .news-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================
   Advert Banner
   ============================================ */
.advert-banner {
    display: block;
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
}

.advert-banner img {
    width: 100%;
    height: auto;
}

.advert-banner .advert-content {
    padding: 1rem;
}

/* ============================================
   Notes Styling
   ============================================ */
.note-editor {
    background: #fffbeb;
    border: 2px solid var(--secondary-colour);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.note-editor textarea {
    width: 100%;
    min-height: 120px;
    border: none;
    background: transparent;
    resize: vertical;
    font-size: 1rem;
}

.note-editor textarea:focus {
    outline: none;
}

.note-display {
    background: #fffbeb;
    border-left: 4px solid var(--secondary-colour);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    padding: 1rem;
    margin-top: 1rem;
}

.note-display .note-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* ============================================
   Rating Stars
   ============================================ */
.rating-stars {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

/* Avoid class name "star" — clashes with Bootstrap / other CSS; keeps icons visible */
.rating-stars .wine-rating-icon {
    font-size: 1.5rem;
    line-height: 1;
    color: #adb5bd;
    cursor: pointer;
    transition: color var(--transition-fast);
    font-family: bootstrap-icons !important;
}

.rating-stars .wine-rating-icon.active,
.rating-stars .wine-rating-icon:hover {
    color: var(--secondary-colour);
}

.wine-rating-picker .wine-rating-num.btn-warning {
    color: #212529;
    border-color: #ffc107;
}

/* ============================================
   Empty States
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

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

.empty-state p {
    font-size: 0.9rem;
}

/* ============================================
   Loading Spinner
   ============================================ */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.loading-spinner::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top-color: var(--primary-colour);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Skeleton Loading
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--border-radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 0.75rem;
}

.skeleton-image {
    height: 120px;
}

/* ============================================
   Form Styles
   ============================================ */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-colour);
    box-shadow: 0 0 0 0.25rem rgba(139, 0, 0, 0.25);
}

.form-check-input:checked {
    background-color: var(--primary-colour);
    border-color: var(--primary-colour);
}

/* ============================================
   GDPR Consent Box
   ============================================ */
.gdpr-consent-box {
    background: #f8f9fa;
    border: 1px solid var(--border-colour);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin: 1rem 0;
}

.gdpr-consent-box h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.gdpr-consent-box .form-check {
    margin-bottom: 0.75rem;
}

.gdpr-consent-box .form-check-label {
    font-size: 0.9rem;
}

.gdpr-consent-box a {
    color: var(--primary-colour);
}

/* ============================================
   Responsive Utilities
   ============================================ */
@media (max-width: 576px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }
    
    .info-table th,
    .info-table td {
        padding: 0.75rem;
    }
    
    .info-table th {
        width: 35%;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .top-nav,
    .bottom-nav,
    .btn,
    .no-print {
        display: none !important;
    }
    
    body {
        padding: 0;
        background: white;
    }
    
    .main-content {
        max-width: none;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
