/* Mood Tracker specific styles */
        .mood-container {
            padding: 40px 0;
        }

        .mood-options {
            display: flex;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 15px;
            margin-bottom: 25px;
        }

        .mood-option {
            flex: 1;
            min-width: 100px;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 15px 10px;
            background-color: #f8f9fa;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 2px solid transparent;
        }

        .mood-option:hover {
            transform: translateY(-5px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }

        .mood-option.selected {
            border-color: var(--primary-color);
            background-color: rgba(64, 115, 192, 0.1);
        }

        .mood-emoji {
            font-size: 36px;
            margin-bottom: 10px;
        }

        .mood-label {
            font-weight: 500;
            font-size: 14px;
        }

        .mood-notes {
            width: 100%;
            margin: 20px 0;
        }

        .mood-notes textarea {
            width: 100%;
            padding: 15px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-family: 'Poppins', sans-serif;
            font-size: 14px;
            min-height: 120px;
            resize: vertical;
        }

        .mood-submit-btn {
            display: block;
            width: 100%;
            max-width: 300px;
            margin: 0 auto;
            padding: 12px;
            font-size: 16px;
        }

        .mood-history {
            display: flex;
            gap: 30px;
            margin-top: 40px;
        }

        .mood-chart {
            flex: 2;
            background: white;
            border-radius: 15px;
            padding: 25px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
        }

        .mood-recommendations {
            flex: 1;
            background: white;
            border-radius: 15px;
            padding: 25px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
            display: flex;
            flex-direction: column;
        }

        .chart-container {
            width: 100%;
            height: 340px;
            margin-top: 18px;
            background: #f8faff;
            border-radius: 14px;
            box-shadow: 0 2px 10px rgba(64, 115, 192, 0.07);
            padding: 38px 10px 10px 10px; /* extra top padding for top dot */
            position: relative;
        }


        /* Camera-related styles */
        .camera-section {
            background: white;
            border-radius: 15px;
            padding: 25px;
            margin-bottom: 30px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
        }

        .camera-container {
            position: relative;
            width: 100%;
            max-width: 500px;
            margin: 0 auto 20px;
            border-radius: 10px;
            overflow: hidden;
        }

        #video {
            width: 100%;
            transform: scaleX(-1);
            /* Mirror effect */
            background-color: #f0f0f0;
            border-radius: 10px;
        }

        #canvas {
            display: none;
            width: 100%;
        }

        .countdown-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.3);
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 80px;
            color: white;
            font-weight: bold;
            display: none;
            z-index: 2;
        }

        .countdown {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 90px;
            color: #fff;
            font-weight: 900;
            letter-spacing: 2px;
            text-shadow: 0 2px 12px rgba(0,0,0,0.25), 0 0 24px #222;
            z-index: 3;
            pointer-events: none;
            background: none;
        }

        .capture-controls {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin: 20px 0;
        }

        .camera-instructions {
            margin: 20px 0;
            padding: 15px;
            background-color: #f0f7ff;
            border-radius: 10px;
            border-left: 4px solid var(--primary-color);
        }

        .camera-instructions h3 {
            margin-bottom: 10px;
            color: var(--primary-color);
        }

        .camera-instructions ul {
            padding-left: 20px;
        }

        .camera-instructions li {
            margin-bottom: 5px;
        }

        @media (max-width: 992px) {
            .mood-history {
                flex-direction: column;
            }
        }

        @media (max-width: 768px) {
            .mood-options {
                justify-content: center;
            }

            .mood-option {
                min-width: 80px;
                flex-basis: calc(20% - 15px);
            }
        }

        @media (max-width: 576px) {
            .mood-option {
                flex-basis: calc(33% - 15px);
            }
        }

        /* Additional styles for AI mood detection */
        .mood-detection-section {
            border-radius: 15px;
            padding: 0;
            margin-bottom: 30px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
            position: relative;
            min-height: 380px;
            overflow: hidden;
        }
        
        .mood-detect-bg-overlay {
            background: rgba(24, 32, 60, 0.92);
            backdrop-filter: blur(4px) brightness(1.1);
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0; left: 0;
            z-index: 1;
        }
        
        .ai-mood-detect-flex {
            position: relative;
            z-index: 2;
            display: flex;
            flex-direction: row;
            align-items: stretch;
            justify-content: space-between;
            width: 100%;
            min-height: 380px;
        }
        
        .ai-mood-detect-left {
            flex: 1 1 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            padding: 50px 40px 50px 60px;
            color: #fff;
            min-width: 320px;
            max-width: 480px;
        }
        
        .ai-mood-detect-left h2 {
            font-size: 2.2rem;
            font-weight: 700;
            margin-bottom: 18px;
            color: #fff;
            letter-spacing: 1px;
        }
        
        .ai-mood-detect-left p {
            font-size: 1.1rem;
            margin-bottom: 32px;
            color: #e0e0e0;
        }
        
        .ai-mood-detect-left .btn-primary {
            font-size: 1.1rem;
            padding: 14px 32px;
            border-radius: 30px;
            font-weight: 600;
            box-shadow: 0 2px 8px rgba(0,0,0,0.12);
            margin-bottom: 10px;
        }
        
        .ai-mood-detect-right {
            flex: 1 1 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: flex-end;
            padding: 40px 60px 40px 20px;
            min-width: 340px;
        }
        
        .ai-mood-detect-right .video-container {
            position: relative;
            width: 100%;
            max-width: 340px;
            margin-bottom: 18px;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 4px 18px rgba(0,0,0,0.18);
            background: #3291d9;
        }
        
        .ai-mood-detect-right #result {
            background: rgb(255, 255, 255);
            border-radius: 10px;
            color: #222;
            margin: 0;
            min-width: 240px;
            font-size: 1.1rem;
        }
        
        @media (max-width: 900px) {
            .ai-mood-detect-flex {
                flex-direction: column;
                align-items: stretch;
            }
            .ai-mood-detect-left, .ai-mood-detect-right {
                max-width: 100%;
                min-width: 0;
                padding: 32px 18px;
                align-items: center;
            }
            .ai-mood-detect-right {
                align-items: center;
                padding: 0 0 32px 0;
            }
        }
        
        @media (max-width: 600px) {
            .ai-mood-detect-section, .mood-detection-section {
                min-height: 0;
                padding: 0;
            }
            .ai-mood-detect-left, .ai-mood-detect-right {
                padding: 18px 6px;
            }
        }
        
        /* Loading indicator for buttons */
        .btn-primary:disabled {
            opacity: 0.7;
            cursor: not-allowed;
        }
        
        .fa-spinner {
            animation: spin 1s linear infinite;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        /* Empty history message */
        .empty-history {
            text-align: center;
            padding: 20px 0;
            color: #666;
            font-style: italic;
        }

        .result-content {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 18px;
            padding: 5px 20px;
            background: linear-gradient(90deg, #ff190054 60%, #0062ff6d 100%);
            backdrop-filter: blur(2px);
            border-radius: 12px;
            box-shadow: 0 2px 10px rgba(64, 115, 192, 0.07);
            font-size: 1.15rem;
            font-weight: 500;
            color: #222;
            min-height: 60px;
            margin-bottom: 8px;
        }
        .result-content .mood-emoji {
            font-size: 2.5rem;
            margin-bottom: 0;
        }

        .chart-container {
            width: 100%;
            height: 340px;
            margin-top: 18px;
            background: #f8faff;
            border-radius: 14px;
            box-shadow: 0 2px 10px rgba(64, 115, 192, 0.07);
            padding: 38px 10px 10px 10px;
            position: relative;
        }
        .mood-chart-container {
            background: #fff;
            border-radius: 15px;
            padding: 28px 28px 18px 28px;
            box-shadow: 0 4px 18px rgba(64, 115, 192, 0.08);
            margin-bottom: 18px;
            flex: 2 1 0;
            min-width: 0;
        }
        .mood-history-list {
            background: #fff;
            border-radius: 15px;
            padding: 28px 22px 18px 22px;
            box-shadow: 0 4px 18px rgba(64, 115, 192, 0.08);
            min-width: 260px;
            flex: 1 1 0;
            max-width: 400px;
        }
        .history-title {
            font-weight: 700;
            margin-bottom: 18px;
            color: #4073c0;
            font-size: 1.18rem;
            letter-spacing: 0.5px;
        }
        .history-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 13px 0;
            border-bottom: 1px solid #f0f0f0;
            font-size: 1.04rem;
        }
        .mood-details {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .mood-label-display {
            display: flex;
            align-items: center;
            gap: 7px;
            font-weight: 600;
        }
        .mood-recommendations {
            background: linear-gradient(120deg, #e9f0fb 60%, #f8fafc 100%);
            border-radius: 15px;
            padding: 32px 28px 24px 28px;
            box-shadow: 0 4px 18px rgba(64, 115, 192, 0.08);
            margin: 32px 0 0 0;
            min-height: 120px;
        }
        .mood-recommendations h3 {
            color: #4073c0;
            font-size: 1.25rem;
            font-weight: 700;
            margin-bottom: 16px;
        }
        #recommendation-content {
            font-size: 1.08rem;
            color: #444;
        }
        .instructions {
            margin-top: 36px;
            padding: 28px 24px 24px 24px;
            background: linear-gradient(120deg, #f8fafc 60%, #e9f0fb 100%);
            border-radius: 15px;
            border-left: 5px solid #4073c0;
            box-shadow: 0 2px 10px rgba(64, 115, 192, 0.07);
            display: flex;
            align-items: flex-start;
            gap: 28px;
        }
        .instructions .instructions-img {
            width: 250px;
            min-width: 150px;
            border-radius: 10px;
            box-shadow: 0 2px 8px rgba(64, 115, 192, 0.10);
            object-fit: cover;
            margin-right: 10px;
        }
        .instructions-content {
            flex: 1;
        }
        .instructions h3 {
            margin-bottom: 12px;
            color: #4073c0;
            font-size: 1.18rem;
            font-weight: 700;
        }
        .instructions ul {
            padding-left: 22px;
            margin-bottom: 0;
        }
        .instructions li {
            margin-bottom: 10px;
            font-size: 1.08rem;
            color: #333;
        }
        @media (max-width: 900px) {
            .mood-history-section {
                flex-direction: column;
                gap: 18px;
            }
            .mood-chart-container, .mood-history-list {
                max-width: 100%;
            }
            .instructions {
                flex-direction: column;
                align-items: stretch;
                gap: 16px;
            }
            .instructions .instructions-img {
                margin: 0 auto 10px auto;
                display: block;
            }
        }
        @media (max-width: 600px) {
            .ai-mood-detect-section, .mood-detection-section {
                min-height: 0;
                padding: 0;
            }
            .ai-mood-detect-left, .ai-mood-detect-right {
                padding: 18px 6px;
            }
            .mood-chart-container, .mood-history-list, .mood-recommendations, .instructions {
                padding: 14px 6px 10px 6px;
            }
            .instructions .instructions-img {
                width: 80px;
            }
        }

        .mood-history-section {
            margin-top: 40px;
            display: flex;
            flex-direction: row;
            gap: 30px;
            align-items: flex-start;
        }
        .mood-chart-container {
            flex: 2 1 0;
            min-width: 0;
            order: 1;
        }
        .mood-history-list {
            flex: 1 1 0;
            min-width: 260px;
            max-width: 400px;
            order: 2;
        }
        @media (max-width: 900px) {
            .mood-history-section {
                flex-direction: column;
                gap: 18px;
            }
            .mood-chart-container, .mood-history-list {
                max-width: 100%;
            }
        }

        /* Masonry Layout for Recommendations */
        .masonry-container {
            columns: 3;
            column-gap: 20px;
            margin-top: 20px;
        }
        
        @media (max-width: 1200px) {
            .masonry-container {
                columns: 2;
            }
        }
        
        @media (max-width: 768px) {
            .masonry-container {
                columns: 1;
                column-gap: 15px;
            }
        }
        
        .masonry-item {
            display: inline-block;
            width: 100%;
            break-inside: avoid;
            margin-bottom: 20px;
            background: #fff;
            border-radius: 12px;
            padding: 20px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            border-left: 4px solid var(--primary-color);
        }
        
        .masonry-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        }
        
        .masonry-item h5 {
            margin: 0 0 10px 0;
            color: var(--primary-color);
            font-weight: 600;
            font-size: 1.1rem;
        }
        
        .masonry-item p {
            margin: 0 0 15px 0;
            color: #666;
            line-height: 1.5;
        }
        
        .quote-text {
            font-style: italic;
            font-size: 1.05rem;
            color: #4a5568;
            border-left: 3px solid var(--primary-color);
            padding-left: 15px;
            margin: 15px 0;
        }
        
        .resource-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 15px;
        }
        
        .duration {
            background: rgba(64, 115, 192, 0.1);
            color: var(--primary-color);
            padding: 3px 8px;
            border-radius: 12px;
            font-size: 0.85rem;
            font-weight: 500;
        }
        
        .btn-small {
            background: var(--primary-color);
            color: white;
            border: none;
            padding: 8px 15px;
            border-radius: 20px;
            font-size: 0.9rem;
            cursor: pointer;
            transition: background 0.3s ease;
        }
        
        .btn-small:hover {
            background: #2c5aa0;
        }
        
        .poster-preview {
            margin: 10px 0;
            text-align: center;
        }
        
        .poster-preview img {
            max-width: 100%;
            height: 150px;
            object-fit: cover;
            border-radius: 8px;
            cursor: pointer;
            transition: transform 0.3s ease;
        }
        
        .poster-preview img:hover {
            transform: scale(1.05);
        }
        
        .recommendations-header {
            text-align: center;
            margin-bottom: 20px;
        }
        
        .recommendations-header h4 {
            color: var(--primary-color);
            font-size: 1.4rem;
            margin-bottom: 8px;
            font-weight: 600;
        }
        
        .recommendations-header p {
            color: #666;
            font-size: 1rem;
        }
        
        /* Modal styles for resources */
        .resource-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }
        
        .modal-content {
            position: relative;
            background: #fff;
            border-radius: 10px;
            padding: 20px;
            max-width: 90%;
            max-height: 90%;
            overflow: auto;
        }
        
        .close-modal {
            position: absolute;
            top: 10px;
            right: 15px;
            font-size: 24px;
            cursor: pointer;
            color: #999;
            font-weight: bold;
        }
        
        .close-modal:hover {
            color: #000;
        }
        
        /* Initially hide recommendations */
        .mood-recommendations {
            display: none;
        }
        
        /* Different item types styling */
        .quote-item {
            border-left-color: #f39c12;
        }
        
        .video-item {
            border-left-color: #e74c3c;
        }
        
        .audio-item {
            border-left-color: #9b59b6;
        }
        
        .poster-item {
            border-left-color: #1abc9c;
        }
        
        .guide-item {
            border-left-color: #34495e;
        }
        
        .book-item {
            border-left-color: #27ae60;
        }
        
        @media (max-width: 768px) {
            .masonry-container {
                columns: 1;
                column-gap: 15px;
            }
            
            .masonry-item {
                padding: 15px;
            }
            
            .modal-content {
                padding: 15px;
                margin: 10px;
            }
        }

        /* Inline Video and Audio Containers */
        .video-container-inline {
            position: relative;
            margin: 15px 0;
        }
        
        .video-container-inline video {
            width: 100%;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }
        
        .fullscreen-btn {
            position: absolute;
            top: 10px;
            right: 10px;
            background: rgba(0, 0, 0, 0.7);
            color: white;
            border: none;
            padding: 8px 10px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            transition: background 0.3s ease;
            z-index: 10;
        }
        
        .fullscreen-btn:hover {
            background: rgba(0, 0, 0, 0.9);
        }
        
        .audio-container-inline {
            margin: 15px 0;
        }
        
        .audio-container-inline audio {
            width: 100%;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }
        
        /* Masonry item improvements for inline media */
        .masonry-item .video-container-inline,
        .masonry-item .audio-container-inline {
            background: #f8f9fa;
            padding: 10px;
            border-radius: 8px;
            margin: 10px 0;
        }
        
        /* Poster 1:1 aspect ratio */
        .poster-preview img {
            width: 100%;
            aspect-ratio: 1/1;
            object-fit: cover;
            border-radius: 8px;
            transition: transform 0.3s ease;
            cursor: pointer;
        }
        
        .poster-preview img:hover {
            transform: scale(1.02);
        }
