:root {
    --wine-primary: #520F17;
    --wine-secondary: #825133;
    --wine-accent: #d4af37;
    --wine-light: #f8f5f0;
}

body {
    font-family: Arial, sans-serif !important;
    background-color: #f2f3f5;

}

/* All headers use Playfair Display */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6,
.navbar-brand,
.modal-title,
.card-title {
    font-family: 'Playfair Display', serif !important;
}

/* Specific overrides for Playfair Display */
.hero-section h1 {
    font-family: 'Playfair Display', serif !important;
    font-weight: 700;
}

.winery-card h5 {
    font-family: 'Playfair Display', serif !important;
}

.stats-number {
    font-family: 'Playfair Display', serif !important;
    font-weight: 700;
}

/* Ensure body text remains Arial */
p, .btn, .form-control, .form-select, .badge, .dropdown-item,
.toast-body, .alert, .breadcrumb, .nav-link, .text-muted,
.small, .form-label, .table, input, select, textarea {
    font-family: Arial, sans-serif !important;
}

/* Lead paragraphs can be Playfair for elegance */
.lead {
    font-family: 'Playfair Display', serif !important;
    font-weight: 400;
    font-style: italic;
}
h1 { font-size: 2.75rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.875rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.1rem; }

.hero-section h1 {
    font-size: 3.5rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.modal-title {
    font-weight: 600;
    letter-spacing: -0.01em;
}
.card-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.btn {
    font-weight: 500;
    letter-spacing: 0.01em;
}

.btn-primary {
    font-weight: 600;
}

/* Navigation */
.navbar-wine {
    background: #272930;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.navbar-wine.scrolled {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.site-logo {
    filter: invert(100%);
}

/* Hero Section */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, var(--wine-primary) 0%, var(--wine-secondary) 100%);
    color: white;
    padding: 4rem 0;
    overflow: hidden;
}

.hero-background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, var(--hero-overlay-opacity, 0.7)) 0%, 
        rgba(50, 50, 50, var(--hero-overlay-opacity, 0.7)) 100%);
    z-index: 1;
}

/* Hero background preview in modal */
.hero-background-preview {
    width: 100%;
    max-width: 300px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero-content {
    position: relative;
    z-index: 1;
}

/* Login Modal Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.login-overlay.show {
    opacity: 1;
    visibility: visible;
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.login-overlay.show .login-card {
    transform: translateY(0);
}

/* Admin Controls */
.admin-controls {
    background: linear-gradient(45deg, var(--wine-primary), var(--wine-secondary));
    color: white;
    padding: 1rem 0;
    display: none;
}

.admin-controls.show {
    display: block;
}

/* Admin action buttons */
.asset-admin-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    gap: 0.25rem;
}

.asset-admin-controls .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Edit User Modal styles */
#editUserModal .form-text {
    font-size: 0.875rem;
    line-height: 1.5;
}

#editUserModal .form-check-input:checked {
    background-color: var(--wine-primary);
    border-color: var(--wine-primary);
}

#editUserModal select:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

#editUserModal .alert-warning {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

/* Winery Cards */
.winery-card {
    background: white;
    border: none;
    border-radius: 0px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
    box-shadow: 1px 1px 0px rgba(0,0,0,0.08);
}

.winery-card:hover {
    box-shadow: -2px 2px 0px rgba(0,0,0,0.15);
}

.winery-card.active {
    border: 3px solid var(--wine-primary);
    transform: scale(1.02);
}

.winery-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.winery-logo-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.winery-logo-placeholder {
    font-size: 4rem;
    color: var(--wine-primary);
    opacity: 0.3;
}

/* Asset Cards */
.asset-card {
    /*background: white;
    border: none;
    border-radius: 0px;
    overflow: hidden;*/
    transition: all 0.3s ease;
    box-shadow: 1px 1px 0px rgba(0,0,0,0.08);
    /*height: 100%;
    position: relative;*/
}

.asset-card:hover {
    box-shadow: -2px 2px 0px rgba(0,0,0,0.15);
}

.asset-card .admin-badge {
    /*
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    */
}


/* Current version highlight */
.card.border-primary {
    border-width: 2px !important;
}

.asset-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.asset-type-photography { color: #e74c3c; }
.asset-type-technical { color: #3498db; }
.asset-type-bottle-shots { color: #8e44ad; }
.asset-type-marketing { color: #2ecc71; }
.asset-type-awards { color: #f39c12; }
.asset-type-logos { color: #9b59b6; }

/* Access Level Badges */
/*
.access-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}
*/

.access-public { background: #2ecc71; color: white; }
.access-trade { background: #3498db; color: white; }
.access-admin { background: #e74c3c; color: white; }

/* Filter Section */
.filter-section {
    background: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0px;
    z-index: 100;
}

/* Stats Section */
.stats-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stats-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--wine-primary);
}

/* Buttons */
.btn-wine {
    background: linear-gradient(45deg, var(--wine-primary), var(--wine-secondary));
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.btn-wine:hover {
    color: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Upload Zone */
.upload-zone {
    border: 3px dashed var(--wine-primary);
    background: var(--wine-light);
    transition: all 0.3s ease;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-zone:hover {
    border-color: var(--wine-secondary);
    background: #fff;
}

.upload-zone.dragover {
    border-color: var(--wine-accent);
    background: #fff;
}

/* Footer */
.footer {
    background: #373940;
    color: white;
    padding: 2rem 0 2rem;
    margin-top: 5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }
}
/* Brand Management Styles */
.brand-card {
    background: white;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.brand-card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.brand-logo-preview {
    height: 100px;
    width: 100px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background: #f8f9fa;
}

.color-preview {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid #ddd;
}
/* Thumbnail System */
.asset-thumbnail {
    width: 100%;
    height: 150px;
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.asset-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* This maintains aspect ratio while filling the container */
    transition: transform 0.3s ease;
}

.asset-thumbnail:hover img {
}

/* For non-image files, show icon */
.asset-thumbnail-icon {
    font-size: 4rem;
    color: #6c757d;
    opacity: 0.5;
}

/* Different aspect ratio options */
.thumbnail-square {
    aspect-ratio: 1 / 1;
    height: auto;
}

.thumbnail-landscape {
    aspect-ratio: 16 / 9;
    height: auto;
}

.thumbnail-portrait {
    aspect-ratio: 3 / 4;
    height: auto;
}

/* File type badges */
.file-type-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: #b1b6bb;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Wine Management Styles */
.badge.bg-info {
  background-color: #0dcaf0 !important;
}

.badge.bg-warning {
  background-color: #ffc107 !important;
  color: #000 !important;
}

.badge.bg-secondary {
  background-color: #6c757d !important;
}

#editWineStatusPreview {
  background: #f8f9fa;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wine-status-toggle {
  cursor: pointer;
  transition: transform 0.2s;
}

.wine-status-toggle:hover {
  transform: scale(1.1);
}

/* Quick edit button styling */
#quickEditWineBtn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

/* Wine management table styles */
#wineManagementModal .table {
  font-size: 0.95rem;
}

#wineManagementModal .btn-group-sm .btn {
  padding: 0.25rem 0.5rem;
}

/* Tab badges */
.nav-tabs .badge {
  font-size: 0.75rem;
}

/* Upcoming wine indicator in dropdown */
#uploadWine optgroup[label="Upcoming Wines"] option {
  color: #0dcaf0;
  font-style: italic;
}

/* Variant cards */
#assetVariantsModal .card {
    transition: all 0.2s ease;
}

#assetVariantsModal .card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Format icons */
.fs-2 {
    font-size: 2rem;
}

/* Variant type badge */
.badge.bg-success {
    cursor: default;
}

/* Preview overlay for better visibility */
.asset-thumbnail-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    padding: 1rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.asset-card:hover .asset-thumbnail-overlay {
    opacity: 1;
}

/* Loading state for thumbnails */
.thumbnail-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
/* PDF Thumbnail Styles */
.pdf-thumbnail-canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

.pdf-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f8f9fa;
}

.pdf-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
}

.asset-thumbnail canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}
/* Bulk selection styles */
.asset-checkbox {
    cursor: pointer;
    width: 1.2rem;
    height: 1.2rem;
}

.asset-card:hover .asset-checkbox {
    transform: scale(1.1);
}

#bulkDownloadControls {
    position: sticky;
    top: 60px;
    z-index: 90;
}

.toast-container {
    z-index: 2000;
}
/* Password strength indicator */
.password-strength {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.strength-bar {
    height: 4px;
    flex: 1;
    background: #e0e0e0;
    border-radius: 2px;
    transition: background 0.3s;
}

.strength-bar.active.weak { background: #dc3545; }
.strength-bar.active.medium { background: #ffc107; }
.strength-bar.active.strong { background: #28a745; }
.strength-bar.active.very-strong { background: #198754; }

.wine-highlight {
  animation: highlightFade 3s ease-out;
}

@keyframes highlightFade {
  0% {
    background-color: var(--bs-success-bg-subtle);
    transform: scale(1.02);
  }
  50% {
    background-color: var(--bs-success-bg-subtle);
    transform: scale(1);
  }
  100% {
    background-color: transparent;
    transform: scale(1);
  }
}

.table-success {
  --bs-table-bg: #d1e7dd;
}

/* Version History Thumbnails */
#versionHistoryModal .img-thumbnail {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 0.25rem;
}

#versionHistoryModal .card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

#versionHistoryModal .border-primary {
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.1);
}

/* Grid view cards */
.version-grid .card {
    transition: transform 0.2s ease;
}

.version-grid .card:hover {
    transform: translateY(-2px);
}
/* PDF Thumbnail Styles */
.pdf-thumbnail-canvas {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background: white;
}

.pdf-thumbnail-container {
    display: inline-block;
}

.pdf-loading {
    border-radius: 4px;
}

#versionHistoryModal .spinner-border-sm {
    width: 1.5rem;
    height: 1.5rem;
}

.thumbnail-loading {
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
background-size: 200% 100%;
animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}

.thumbnail-loaded {
animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}

.thumbnail-error {
opacity: 0.5;
filter: grayscale(1);
}

/* Optimize image rendering */
.asset-card img {
will-change: transform;
contain: layout style paint;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .navbar,
    .filter-section,
    .btn,
    .modal {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .hero-section {
        background: none;
        color: black;
        padding: 1rem 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}