/* Journal-Specific Styles */

/* Journal Header */
.journal-header {
    background: rgba(75, 54, 33, 0.3);
    border: 1px solid rgba(199, 167, 108, 0.2);
    backdrop-filter: blur(10px);
}

/* Cigar Card Images */
.cigar-card-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 0.75rem;
    border: 2px solid rgba(199, 167, 108, 0.2);
    transition: all 0.3s ease;
    background: rgba(75, 54, 33, 0.3);
}

.cigar-card-image:hover {
    border-color: rgba(199, 167, 108, 0.4);
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.cigar-card-image-placeholder {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, rgba(75, 54, 33, 0.4) 0%, rgba(88, 47, 43, 0.4) 100%);
    border: 2px dashed rgba(199, 167, 108, 0.3);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(199, 167, 108, 0.6);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cigar-card-image-placeholder:hover {
    border-color: rgba(199, 167, 108, 0.5);
    color: rgba(199, 167, 108, 0.8);
}

/* Review Session Images */
.review-session-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.75rem;
    border: 2px solid rgba(199, 167, 108, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.review-session-image:hover {
    border-color: rgba(199, 167, 108, 0.5);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.review-session-image-placeholder {
    width: 80px;
    height: 80px;
    background: rgba(75, 54, 33, 0.3);
    border: 2px dashed rgba(199, 167, 108, 0.2);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(199, 167, 108, 0.5);
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* Image Modal for Full View */
.image-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.image-modal-content {
    max-width: 95vw;
    max-height: 95vh;
    border-radius: 1rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(199, 167, 108, 0.3);
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.image-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(184, 92, 56, 0.9);
    border: 2px solid #EDE6DC;
    color: #EDE6DC;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 101;
}

.image-modal-close:hover {
    background: rgba(184, 92, 56, 1);
    border-color: #C7A76C;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(184, 92, 56, 0.5);
}

/* Journal Cards */
.journal-card {
    background: rgba(75, 54, 33, 0.8) !important;
    border: 2px solid rgba(199, 167, 108, 0.3) !important;
    backdrop-filter: blur(10px) !important;
    transition: all 0.3s ease !important;
}

.journal-card:hover {
    background: rgba(75, 54, 33, 0.9) !important;
    border-color: rgba(199, 167, 108, 0.5) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
    border-radius: 1rem !important;
}

.journal-card:focus {
    border-radius: 1rem !important;
    outline: none !important;
    border-color: #C7A76C !important;
}

/* Filter Buttons */
.filter-button {
    background: rgba(75, 54, 33, 0.6);
    border: 2px solid rgba(199, 167, 108, 0.3);
    color: #EDE6DC;
    transition: all 0.3s ease;
}

.filter-button.active {
    background: rgba(184, 92, 56, 0.8);
    border-color: #B85C38;
    color: #EDE6DC;
}

.filter-button:hover {
    background: rgba(75, 54, 33, 0.8);
    border-color: rgba(199, 167, 108, 0.5);
}

/* Cigar Badge */
.cigar-badge {
    background: rgba(184, 92, 56, 0.2);
    border: 1px solid rgba(184, 92, 56, 0.4);
    color: #B85C38;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Rating Stars */
.rating-stars {
    color: #C7A76C;
    font-size: 1rem;
}

/* Modal Styles */
.modal-content {
    background: linear-gradient(135deg, rgba(75, 54, 33, 0.95) 0%, rgba(88, 47, 43, 0.95) 100%);
    border: 2px solid rgba(199, 167, 108, 0.3);
    border-radius: 1.5rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    max-height: none;
    position: relative;
}

/* Improved Modal Close Button */
.modal-close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(184, 92, 56, 0.9);
    border: 2px solid #EDE6DC;
    color: #EDE6DC;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.modal-close-button:hover {
    background: rgba(184, 92, 56, 1);
    border-color: #C7A76C;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(184, 92, 56, 0.5);
}

.modal-close-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(199, 167, 108, 0.3);
}

/* Enhanced Modal with better accessibility */
.modal-overlay {
    touch-action: manipulation;
    -webkit-overflow-scrolling: touch;
}

.modal-container {
    scroll-margin-top: 2rem;
    scroll-margin-bottom: 2rem;
}

/* Better mobile modal experience */
@media (max-width: 768px) {
    .modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
        border-radius: 1rem;
    }
    
    .modal-close-button {
        top: 0.5rem;
        right: 0.5rem;
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* Smooth scroll behavior for modal content */
.modal-scroll-area {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(199, 167, 108, 0.3) transparent;
}

.modal-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.modal-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.modal-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(199, 167, 108, 0.3);
    border-radius: 3px;
}

.modal-scroll-area::-webkit-scrollbar-thumb:hover {
    background: rgba(199, 167, 108, 0.5);
}

/* Premium Card Styles for Modal */
.premium-card {
    background: rgba(75, 54, 33, 0.4) !important;
    border: 1px solid rgba(199, 167, 108, 0.2) !important;
    border-radius: 1rem !important;
    backdrop-filter: blur(10px) !important;
}

.premium-card:hover {
    border-color: rgba(199, 167, 108, 0.4) !important;
    border-radius: 1rem !important;
}

/* Modal Rating Category Badges */
.rating-category-poor { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.3); color: rgb(252, 165, 165); }
.rating-category-fair { background: rgba(245, 158, 11, 0.2); border-color: rgba(245, 158, 11, 0.3); color: rgb(251, 191, 36); }
.rating-category-good { background: rgba(234, 179, 8, 0.2); border-color: rgba(234, 179, 8, 0.3); color: rgb(250, 204, 21); }
.rating-category-excellent { background: rgba(34, 197, 94, 0.2); border-color: rgba(34, 197, 94, 0.3); color: rgb(134, 239, 172); }
.rating-category-outstanding { background: rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.3); color: rgb(110, 231, 183); }

/* Modal Specification Cards */
.spec-card {
    background: rgba(75, 54, 33, 0.3);
    border: 1px solid rgba(199, 167, 108, 0.1);
    border-radius: 0.75rem;
}

.spec-card .spec-icon {
    background: rgba(199, 167, 108, 0.2);
    border-radius: 0.5rem;
}

/* Review Session Cards */
.review-session-card {
    background: rgba(75, 54, 33, 0.2);
    border: 1px solid rgba(199, 167, 108, 0.2);
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.review-session-card:hover {
    border-color: rgba(199, 167, 108, 0.4);
    background: rgba(75, 54, 33, 0.3);
}

/* Session Number Badge */
.session-number-badge {
    background: rgba(199, 167, 108, 0.2);
    border: 1px solid rgba(199, 167, 108, 0.3);
    border-radius: 50%;
}

/* Notes Container */
.notes-container {
    background: rgba(75, 54, 33, 0.2);
    border: 1px solid rgba(199, 167, 108, 0.1);
    border-radius: 0.5rem;
}

/* Empty States */
.empty-state-card {
    background: rgba(75, 54, 33, 0.2);
    border: 1px solid rgba(199, 167, 108, 0.1);
    border-radius: 0.75rem;
}

.empty-state-icon {
    background: rgba(199, 167, 108, 0.2);
    border-radius: 50%;
}

/* Ensure text visibility on journal cards */
.journal-card .text-text-secondary {
    color: #EDE6DC !important;
}

.journal-card .text-text-secondary\/80 {
    color: rgba(237, 230, 220, 0.8) !important;
}

.journal-card .text-text-secondary\/70 {
    color: rgba(237, 230, 220, 0.7) !important;
}

.journal-card .text-text-secondary\/60 {
    color: rgba(237, 230, 220, 0.6) !important;
}

/* Fix modal h3 text visibility */
.modal-content h3,
.modal-content h4 {
    color: #EDE6DC !important;
}

/* Fix specification card text */
.spec-card h4,
.bg-primary\/30 h4 {
    color: #EDE6DC !important;
}

/* Fix review session text */
.review-session-card .text-text-secondary,
.premium-card .text-text-secondary {
    color: #EDE6DC !important;
}

/* Fix all text in brown/dark backgrounds */
.bg-primary\/30 .text-text-secondary,
.bg-primary\/20 .text-text-secondary {
    color: #EDE6DC !important;
}

/* Override any dark text in modal sections */
.modal-content .text-text-secondary,
.modal-content .text-lg,
.modal-content .text-xl {
    color: #EDE6DC !important;
}

/* Fix review notes text specifically */
.notes-container .text-text-secondary,
.notes-container p {
    color: #EDE6DC !important;
}

/* Comprehensive text fixes for all journal modal content */
.modal-content h1,
.modal-content h2,
.modal-content h3,
.modal-content h4,
.modal-content h5,
.modal-content h6 {
    color: #EDE6DC !important;
}

.modal-content p,
.modal-content span,
.modal-content div {
    color: #EDE6DC !important;
}

/* Override Tailwind text classes in modal */
.modal-content .text-highlight {
    color: #C7A76C !important;
}

.modal-content .text-text-primary {
    color: #EDE6DC !important;
}

/* Review session specific fixes */
.review-session-card h5,
.review-session-card p,
.review-session-card span {
    color: #EDE6DC !important;
}

/* Empty state text */
.empty-state-card h3,
.empty-state-card p {
    color: #EDE6DC !important;
}

/* Force all dark text to light in journal areas */
[class*="text-text-secondary"] {
    color: #EDE6DC !important;
}

[class*="text-charcoal"] {
    color: #EDE6DC !important;
}

/* Material Design Enhancements */
.rating-stars svg {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rating-stars:hover svg {
    transform: scale(1.1);
}

/* Serif Typography for Headers */
.font-serif {
    font-family: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
    font-feature-settings: 'liga' 1, 'dlig' 1;
}

/* Material Design Card Elevation */
.group:hover {
    transform: translateY(-2px);
}

/* Smooth Rating Transitions */
.rating-stars svg path {
    transition: fill 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced Focus States for Accessibility */
.group:focus-within {
    outline: 2px solid rgba(245, 158, 11, 0.5);
    outline-offset: 2px;
}

/* Material Design Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.group:active::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.3);
    transform: translate(-50%, -50%);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

/* Improved Backdrop Blur Support */
.backdrop-blur-sm {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Enhanced Shadow Definitions */
.shadow-inner {
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.1);
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Material Design Color Transitions */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .border-amber-200\/20 {
        border-color: rgba(245, 158, 11, 0.6);
    }
    
    .text-cream\/70 {
        color: rgba(237, 230, 220, 0.9);
    }
    
    .bg-gradient-to-br {
        background: rgba(245, 158, 11, 0.1);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .transition-all,
    .rating-stars svg,
    .group:hover {
        transition: none;
        transform: none;
    }
    
    .group:active::before {
        animation: none;
    }
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    .bg-gradient-to-br.from-amber-50\/5 {
        background: linear-gradient(to bottom right, rgba(120, 53, 15, 0.1), rgba(154, 52, 18, 0.1));
    }
}

/* Enhanced Distinct Section Styling */
.ring-2.ring-amber-300\/30 {
    box-shadow: 
        0 0 0 2px rgba(252, 211, 77, 0.3),
        0 0 20px rgba(245, 158, 11, 0.2),
        0 10px 25px rgba(0, 0, 0, 0.15);
}

.ring-2.ring-orange-300\/25 {
    box-shadow: 
        0 0 0 2px rgba(253, 186, 116, 0.25),
        0 0 20px rgba(234, 88, 12, 0.2),
        0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Enhanced Backdrop Blur */
.backdrop-blur-md {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Glowing Border Effects */
.border-2.border-amber-400\/40:hover {
    border-color: rgba(251, 191, 36, 0.6);
    box-shadow: 
        0 0 0 1px rgba(251, 191, 36, 0.4),
        0 0 15px rgba(245, 158, 11, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.border-2.border-orange-400\/40:hover {
    border-color: rgba(251, 146, 60, 0.6);
    box-shadow: 
        0 0 0 1px rgba(251, 146, 60, 0.4),
        0 0 15px rgba(234, 88, 12, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Enhanced Text Contrast */
.text-amber-100 {
    color: #fef3c7;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.text-orange-100 {
    color: #fed7aa;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.text-amber-200 {
    color: #fde68a;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.text-orange-200 {
    color: #fecaca;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Gradient Background Enhancements */
.bg-gradient-to-br.from-amber-600\/25 {
    background: linear-gradient(
        to bottom right,
        rgba(217, 119, 6, 0.25) 0%,
        rgba(234, 88, 12, 0.2) 50%,
        rgba(180, 83, 9, 0.25) 100%
    );
}

.bg-gradient-to-br.from-orange-600\/20 {
    background: linear-gradient(
        to bottom right,
        rgba(234, 88, 12, 0.2) 0%,
        rgba(217, 119, 6, 0.15) 50%,
        rgba(194, 65, 12, 0.2) 100%
    );
}

/* Enhanced Shadow Definitions */
.shadow-xl {
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

.hover\:shadow-xl:hover {
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 0 20px rgba(245, 158, 11, 0.1);
}

/* Ring Offset Enhancements */
.ring-offset-2.ring-offset-primary\/50 {
    box-shadow: 
        0 0 0 2px rgba(75, 54, 33, 0.5),
        var(--tw-ring-offset-shadow, 0 0 #0000),
        var(--tw-ring-shadow, 0 0 #0000),
        var(--tw-shadow, 0 0 #0000);
}

/* Performance Overview Section Specific */
.bg-gradient-to-br.from-amber-500\/20.to-orange-600\/20 {
    background: linear-gradient(
        to bottom right,
        rgba(245, 158, 11, 0.2) 0%,
        rgba(234, 88, 12, 0.2) 100%
    );
    border: 2px solid rgba(251, 191, 36, 0.3);
}

.bg-gradient-to-br.from-amber-500\/20.to-orange-600\/20:hover {
    background: linear-gradient(
        to bottom right,
        rgba(245, 158, 11, 0.3) 0%,
        rgba(234, 88, 12, 0.3) 100%
    );
    transform: translateY(-1px);
}

/* Specifications Section Specific */
.bg-gradient-to-br.from-orange-500\/15.to-amber-600\/15 {
    background: linear-gradient(
        to bottom right,
        rgba(249, 115, 22, 0.15) 0%,
        rgba(217, 119, 6, 0.15) 100%
    );
}

.bg-gradient-to-br.from-orange-500\/15.to-amber-600\/15:hover {
    background: linear-gradient(
        to bottom right,
        rgba(249, 115, 22, 0.25) 0%,
        rgba(217, 119, 6, 0.25) 100%
    );
}

/* High Contrast Mode Enhancements */
@media (prefers-contrast: high) {
    .border-2.border-amber-400\/40 {
        border-color: rgba(251, 191, 36, 0.8);
    }
    
    .border-2.border-orange-400\/40 {
        border-color: rgba(251, 146, 60, 0.8);
    }
    
    .text-amber-100,
    .text-orange-100 {
        color: #ffffff;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }
}

/* Image Loading States */
.image-loading-container {
    position: relative;
    display: inline-block;
    width: 100%;
    height: 100%;
}

.image-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(75, 54, 33, 0.4) 0%, rgba(88, 47, 43, 0.4) 100%);
    border: 2px solid rgba(199, 167, 108, 0.3);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    z-index: 10;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.image-loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(199, 167, 108, 0.2);
    border-top: 2px solid #C7A76C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.review-session-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(75, 54, 33, 0.6);
    border: 2px solid rgba(199, 167, 108, 0.3);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(1px);
    z-index: 10;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.review-session-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(199, 167, 108, 0.2);
    border-top: 2px solid #C7A76C;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Loading state for cigar card images */
.cigar-card-image-container {
    position: relative;
    width: 100%;
    height: 120px;
}

/* Loading state for review session images */
.review-session-image-container {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

/* Image loading states - use opacity instead of display for proper loading */
.image-loading {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.image-loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.image-error {
    opacity: 0;
}

.loading-state-hidden {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading-state-visible {
    opacity: 1;
}