/* Ultimate Wine Portal CSS with All Advanced Features */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --warning-color: #f39c12;
    --border-color: #e9ecef;
    --shadow-light: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-medium: 0 8px 25px rgba(0,0,0,0.15);
    --shadow-heavy: 0 15px 45px rgba(0,0,0,0.2);
    --border-radius: 8px;
    --border-radius-large: 15px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: var(--border-radius-large);
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-medium);
}

header h1 {
    color: var(--text-dark);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 300;
}

header p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.access-indicator {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 500;
    display: inline-block;
    font-size: 0.9rem;
}

/* Section Styles */
.public-section, .login-section, .trade-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: var(--border-radius-large);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-medium);
}

.access-note {
    background: linear-gradient(135deg, #e8f5e8, #f0f8f0);
    border: 2px solid var(--success-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    color: #2d5a2d;
}

/* Enhanced Winery Grid */
.winery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.winery-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

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

.winery-card h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.wine-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.wine-type {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.winery-contact {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
}

/* User Info Bar */
.user-info-bar {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-light);
    border-left: 4px solid var(--primary-color);
}

.user-details {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#userWelcome {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.user-role-badge {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logout-btn-primary {
    background: linear-gradient(45deg, var(--error-color), #c0392b);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Dashboard Tabs */
.dashboard-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.tab-btn.active {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Enhanced Asset Grid */
.assets-grid, .enhanced-assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.asset-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.asset-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.asset-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.asset-card:hover .asset-thumbnail img {
    transform: scale(1.05);
}

.asset-thumbnail-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon {
    font-size: 3rem;
    opacity: 0.6;
}

.asset-header {
    padding: 1rem 1rem 0 1rem;
}

.asset-header h4 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    line-height: 1.3;
}

.asset-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.asset-category {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.access-badge {
    background: var(--border-color);
    color: var(--text-light);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.access-badge[data-level="public"] { background: var(--success-color); color: white; }
.access-badge[data-level="trade"] { background: var(--warning-color); color: white; }
.access-badge[data-level="admin"] { background: var(--error-color); color: white; }

.asset-info {
    padding: 0 1rem;
}

.asset-info p {
    color: var(--text-light);
    margin: 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.asset-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.asset-meta span {
    background: #f8f9fa;
    color: var(--text-light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.asset-actions {
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid var(--border-color);
}

/* Upload Sections */
.upload-modes {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.upload-mode-btn {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.upload-mode-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.upload-mode-btn.active {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
}

.upload-section {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

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

.form-group small {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Enhanced Form Inputs */
input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
    min-height: 80px;
    resize: vertical;
}

input[type="file"] {
    border: 2px dashed var(--primary-color);
    background: linear-gradient(135deg, #f8f9ff, #f0f4ff);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="file"]:hover {
    border-color: var(--secondary-color);
    background: linear-gradient(135deg, #f0f4ff, #e8f0ff);
}

/* Bulk Upload */
.bulk-upload-form {
    max-width: 800px;
}

.bulk-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.file-drop-zone {
    border: 3px dashed var(--primary-color);
    border-radius: var(--border-radius);
    padding: 3rem;
    text-align: center;
    background: linear-gradient(135deg, #f8f9ff, #f0f4ff);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.file-drop-zone:hover, .file-drop-zone.drag-over {
    border-color: var(--secondary-color);
    background: linear-gradient(135deg, #f0f4ff, #e8f0ff);
    transform: scale(1.02);
}

.file-drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.drop-content p {
    margin: 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--primary-color);
}

.bulk-files-list {
    margin: 2rem 0;
    max-height: 400px;
    overflow-y: auto;
}

.bulk-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    background: white;
}

.file-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: var(--text-dark);
}

.file-size {
    font-size: 0.9rem;
    color: var(--text-light);
}

.file-status {
    text-align: right;
}

.status-text {
    font-size: 0.9rem;
    font-weight: 500;
}

.bulk-progress {
    margin-top: 2rem;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    margin-top: 1rem;
    font-weight: 500;
    color: var(--text-dark);
}

/* Analytics Dashboard */
.analytics-dashboard {
    max-width: 1200px;
}

.analytics-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    text-align: center;
    border-top: 4px solid var(--primary-color);
}

.stat-card h4 {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.stat-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.analytics-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.chart-container {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.chart-container h4 {
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.geo-chart {
    max-height: 300px;
    overflow-y: auto;
}

.geo-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    background: #f8f9fa;
}

.country {
    min-width: 60px;
    font-weight: 500;
    color: var(--text-dark);
}

.geo-bar {
    flex: 1;
    height: 20px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.geo-fill {
    height: 100%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.geo-count {
    min-width: 40px;
    text-align: right;
    font-weight: 500;
    color: var(--text-dark);
}

.top-assets {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.top-assets h4 {
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.top-assets-list {
    max-height: 400px;
    overflow-y: auto;
}

.top-asset-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

.top-asset-item:hover {
    background: #f8f9fa;
}

.rank {
    min-width: 40px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.asset-title {
    flex: 1;
    font-weight: 500;
    color: var(--text-dark);
}

.download-count {
    font-weight: 500;
    color: var(--text-light);
}

/* User Management */
.user-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.3s ease;
}

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

.users-list {
    display: grid;
    gap: 1rem;
}

.user-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s ease;
}

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

.user-card.inactive {
    opacity: 0.6;
    background: #f8f9fa;
}

.user-info h4 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.user-info p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.user-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
}

.role-admin { background: var(--error-color); }
.role-trade { background: var(--primary-color); }

.user-meta span {
    background: #f8f9fa;
    color: var(--text-light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.delete-user-btn {
    background: var(--error-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.delete-user-btn:hover {
    background: #c0392b;
}

/* Branding Editor */
.branding-editor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1000px;
}

.branding-form {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.color-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

input[type="color"] {
    width: 100%;
    height: 50px;
    padding: 0;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
}

.save-btn, .preview-btn {
    width: 100%;
    margin-bottom: 1rem;
}

.save-btn {
    background: linear-gradient(45deg, var(--success-color), #2ecc71);
}

.preview-btn {
    background: linear-gradient(45deg, var(--warning-color), #e67e22);
}

.branding-preview {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.preview-container {
    border: 2px dashed var(--border-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    background: #f8f9fa;
}

.preview-header {
    text-align: center;
    margin-bottom: 1rem;
}

.preview-header h1 {
    margin-bottom: 0.5rem;
}

.preview-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 500;
    margin-bottom: 1rem;
}

.preview-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.preview-card h3 {
    margin-bottom: 1rem;
}

.preview-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: var(--border-radius-large);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-heavy);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--text-dark);
}

.invite-btn {
    background: linear-gradient(45deg, var(--success-color), #2ecc71);
    width: 100%;
}

/* Enhanced Buttons */
button, .download-btn, .upload-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

button:hover:not(:disabled), .download-btn:hover, .upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    text-decoration: none;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.download-btn {
    background: linear-gradient(45deg, var(--success-color), #2ecc71);
    flex: 1;
    min-width: 120px;
}

.delete-btn {
    background: linear-gradient(45deg, var(--error-color), #c0392b);
    padding: 8px 16px;
    font-size: 0.9rem;
    min-width: auto;
}

.upload-btn {
    background: linear-gradient(45deg, var(--success-color), #2ecc71);
    font-size: 1.1rem;
    padding: 15px 30px;
    width: 100%;
}

.filter-btn {
    background: linear-gradient(45deg, #3498db, #2980b9);
    white-space: nowrap;
}

/* Enhanced Asset Filters */
.asset-filters, .enhanced-asset-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.asset-filters select, .enhanced-asset-filters select {
    min-width: 200px;
    margin: 0;
}

/* Email Action Buttons */
.email-actions {
    max-width: 500px;
}

.email-btn, .copy-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    margin: 0 0.5rem 0.5rem 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-size: 0.9rem;
}

.email-btn:hover, .copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.copy-btn {
    background: linear-gradient(45deg, var(--success-color), #2ecc71);
}

.email-actions details {
    margin-top: 1rem;
}

.email-actions summary {
    color: var(--text-dark);
    font-weight: 500;
}

/* Messages */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
    box-shadow: var(--shadow-medium);
}

.message.success {
    background: linear-gradient(45deg, var(--success-color), #2ecc71);
}

.message.error {
    background: linear-gradient(45deg, var(--error-color), #c0392b);
}

.message.warning {
    background: linear-gradient(45deg, var(--warning-color), #e67e22);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading States */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    font-style: italic;
    position: relative;
}

.loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

.no-assets, .no-users {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border: 2px dashed var(--border-color);
    font-style: italic;
}

/* Logout Button */
.logout-btn {
    background: var(--error-color);
    padding: 8px 16px;
    font-size: 0.9rem;
    width: auto;
    margin-left: 1rem;
    display: inline-block;
}

.logout-btn:hover {
    background: #c0392b;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: normal;
    margin-left: 0.5rem;
}

/* Section Headers */
h2 {
    color: var(--text-dark);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 300;
}

h3 {
    color: var(--text-dark);
    font-size: 1.4rem;
    margin-bottom: 1rem;
    font-weight: 400;
}

h4 {
    color: var(--text-dark);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* Contact Info Grid */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.contact-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-color);
}

.login-help {
    margin-top: 1rem;
    text-align: center;
}

.login-help a {
    color: var(--primary-color);
    text-decoration: none;
}

.login-help a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .analytics-charts {
        grid-template-columns: 1fr;
    }
    
    .branding-editor {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .dashboard-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        text-align: center;
    }
    
    .winery-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .asset-filters, .enhanced-asset-filters {
        flex-direction: column;
    }
    
    .asset-filters select, .enhanced-asset-filters select {
        min-width: auto;
    }
    
    .assets-grid, .enhanced-assets-grid {
        grid-template-columns: 1fr;
    }
    
    .analytics-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bulk-settings {
        grid-template-columns: 1fr;
    }
    
    .color-inputs, .contact-inputs {
        grid-template-columns: 1fr;
    }
    
    .user-actions {
        flex-direction: column;
    }
    
    .user-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .asset-actions {
        flex-direction: column;
    }
    
    .logout-btn {
        display: block;
        margin: 1rem 0 0 0;
        width: 100%;
    }
    
    .message {
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 1.5rem;
    }
    
    .upload-modes {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .analytics-summary {
        grid-template-columns: 1fr;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .file-drop-zone {
        padding: 2rem 1rem;
    }
    
    .bulk-file-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .login-section, .dashboard-tabs, .asset-actions, .user-actions {
        display: none;
    }
    
    .trade-section {
        display: block !important;
    }
    
    .tab-content {
        display: block !important;
    }
    
    .asset-card {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* Focus Styles for Accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.download-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .asset-card, .user-card, .stat-card {
        border: 2px solid var(--text-dark);
    }
    
    .message {
        border: 2px solid white;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


