/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

/* Touch-friendly improvements */
button, .nav-link, .action-btn, .calculate-btn, .reset-btn {
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
    touch-action: manipulation; /* Prevents double-tap zoom */
    min-height: 44px; /* Minimum touch target size */
}

/* Story Module Enhanced Styles */
@keyframes storyFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.story-scene {
    animation: storyFadeIn 0.4s ease-in;
}

.story-text-paragraph {
    margin-bottom: 12px;
    line-height: 1.8;
}

.story-bold {
    font-weight: 700;
    color: #2c3e50;
}

.story-italic {
    font-style: italic;
    color: #5a6c7d;
}

.story-arrow {
    color: #667eea;
    font-weight: 600;
    font-size: 1.1em;
    margin: 0 4px;
    display: inline-block;
}

.story-icon {
    font-size: 1.2em;
    margin-right: 6px;
    display: inline-block;
    vertical-align: middle;
}

.story-choice-btn {
    position: relative;
}

.story-choice-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: transparent;
    transition: all 0.3s ease;
    border-radius: 10px 0 0 10px;
}

.story-choice-btn:hover::before {
    background: currentColor;
    opacity: 0.3;
}

.story-choice-btn.story-end {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.story-choice-btn.story-back {
    background: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
}

/* Flip Cards Widget Styles */
.flip-cards-widget {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.flip-cards-header {
    text-align: center;
    margin-bottom: 24px;
}

.flip-cards-header h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.8em;
}

.flip-cards-description {
    color: #7f8c8d;
    font-size: 0.95em;
    margin-top: 10px;
}

.flip-cards-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
    align-items: end;
}

.flip-cards-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9em;
    color: #5a6c7d;
}

.flip-cards-field span {
    font-weight: 600;
}

.flip-cards-field input,
.flip-cards-field select {
    padding: 10px 12px;
    border: 1px solid #dfe3ea;
    border-radius: 8px;
    font-size: 1em;
    transition: border 0.2s ease, box-shadow 0.2s ease;
    background-color: #fff;
}

.flip-cards-field input:focus,
.flip-cards-field select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102,126,234,0.2);
    outline: none;
}

.flip-cards-reset {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #dfe3ea;
    background: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.flip-cards-reset:hover {
    border-color: #667eea;
    color: #667eea;
}

.flip-cards-stats {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 16px;
}

.flip-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.flip-card-grid-item {
    perspective: 1000px;
}

.flip-card {
    position: relative;
    width: 100%;
    min-height: 260px;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    cursor: pointer;
}

.flip-card--mini {
    min-height: 280px;
}

.flip-card--mini .card-side {
    padding: 20px;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
    overflow: hidden;
}

.flip-card--mini .card-content {
    max-height: 100%;
    overflow: auto;
    width: 100%;
}

.flip-card--mini .card-content::-webkit-scrollbar {
    width: 6px;
}

.flip-card--mini .card-content::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 6px;
}

.flip-card--mini .card-side::-webkit-scrollbar {
    width: 6px;
}

.flip-card--mini .card-side::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 6px;
}

.flip-card--mini .card-side::-webkit-scrollbar-track {
    background: transparent;
}

.flip-card.flipped {
    transform: rotateY(180deg);
}

.card-side {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    padding: 24px;
    box-sizing: border-box;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.card-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.card-back {
    background: white;
    color: #2c3e50;
    transform: rotateY(180deg);
    border: 2px solid #e0e0e0;
}

.flip-card-case {
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 6px;
}

.flip-card-board {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.flip-card-topic {
    font-size: 1em;
    margin-bottom: 14px;
}

.flip-card-summary {
    font-size: 0.95em;
    line-height: 1.6;
}

.flip-card-guidelines {
    width: 100%;
    text-align: left;
    margin: 12px 0;
}

.flip-card-guidelines-label {
    font-size: 0.8em;
    font-weight: 600;
    color: #5a6c7d;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
}

.flip-card-guidelines ul {
    margin: 0;
    padding-left: 18px;
    font-size: 0.85em;
    line-height: 1.4;
    color: #2c3e50;
}

.flip-card-hint {
    font-size: 0.85em;
    margin-top: auto;
    opacity: 0.9;
}

.flip-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.flip-card-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8em;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.flip-card-tag--group {
    background: rgba(0, 0, 0, 0.2);
}

.flip-card-tag--epc {
    background: rgba(102, 126, 234, 0.15);
    color: #4a4e69;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.flip-cards-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    border: 1px dashed #dfe3ea;
    border-radius: 12px;
    color: #5a6c7d;
}

/* Printable Cheat Sheets */
.nav-column-cheat-sheets .nav-link {
    border-left-color: #111827;
}

.cheat-sheet-tag {
    background: rgba(17, 24, 39, 0.08);
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 600;
}

.cheat-sheet {
    background: #ffffff;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
    color: #111827;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cheat-sheet-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 16px;
}

.cheat-sheet-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.cheat-sheet-label {
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 0.3em;
    color: #6b7280;
    margin-bottom: 6px;
}

.cheat-sheet-header h2 {
    font-size: clamp(1.4em, 3vw, 1.95em);
    margin-bottom: 4px;
}

.cheat-sheet-ref {
    font-weight: 600;
    color: #4f46e5;
}

.cheat-sheet-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.cheat-sheet-chip {
    background: rgba(79, 70, 229, 0.08);
    color: #4338ca;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85em;
    font-weight: 600;
}

.cheat-sheet-print-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
    touch-action: manipulation;
    position: relative;
    z-index: 10;
}

.cheat-sheet-print-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.cheat-sheet-print-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.cheat-sheet-print-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.cheat-sheet-print-icon {
    font-size: 1.1em;
    line-height: 1;
}

.cheat-sheet-print-text {
    font-size: 0.95em;
}

.cheat-sheet-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cheat-sheet-graph {
    background: #f8fafc;
    border: 1px solid #e0e7ff;
    border-radius: 16px;
    padding: 24px;
}

.cheat-sheet-graph svg {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    display: block;
    padding: 20px;
    overflow: visible;
}

.cheat-edge {
    stroke: #64748b;
    stroke-width: 0.8;
    stroke-linecap: round;
    fill: none;
    opacity: 0.6;
}

.cheat-edge--option {
    stroke: #3b82f6;
    opacity: 0.7;
}

.cheat-edge--sub {
    stroke: #7c3aed;
    stroke-dasharray: 3 2;
    opacity: 0.6;
}

.cheat-edge--details {
    stroke: #64748b;
    opacity: 0.5;
}

.cheat-edge--condition {
    stroke: #f97316;
    stroke-dasharray: 2 2;
    opacity: 0.6;
}

.cheat-edge--result {
    stroke: #10b981;
    opacity: 0.6;
}

.cheat-edge--excluded {
    stroke: #dc2626;
    stroke-dasharray: 1 3;
    opacity: 0.5;
}

.cheat-node circle {
    fill: #ffffff;
    stroke: #0f172a;
    stroke-width: 1.5;
}

.cheat-node--concept-main circle {
    fill: #3b82f6;
    stroke: #2563eb;
}

.cheat-node--category circle {
    fill: #7c3aed;
    stroke: #6d28d9;
}

.cheat-node--method circle {
    fill: #0f172a;
    stroke: #0f172a;
}

.cheat-node--place circle {
    fill: #0369a1;
    stroke: #0284c7;
}

.cheat-node--condition circle {
    fill: #f97316;
    stroke: #ea580c;
}

.cheat-node--process circle {
    fill: #047857;
    stroke: #059669;
}

.cheat-node--not-allowed circle {
    fill: #dc2626;
    stroke: #b91c1c;
    stroke-dasharray: 2 2;
}

.cheat-node-label {
    font-size: 10px;
    font-weight: 500;
    fill: #0f172a;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
}

.cheat-node.is-highlighted circle {
    stroke-width: 2.5;
    stroke: #facc15;
}

/* Block-based layout styles */
.cheat-sheet-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

.cheat-block {
    padding: 20px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cheat-block:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.cheat-block-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.cheat-block-icon {
    font-size: 1.4em;
    line-height: 1;
    flex-shrink: 0;
}

.cheat-block-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
}

.cheat-block-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.cheat-block-items {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
    color: #334155;
    line-height: 1.6;
}

.cheat-block-items li {
    margin-bottom: 6px;
    font-size: 0.95em;
}

.cheat-block-items li:last-child {
    margin-bottom: 0;
}

.cheat-block-refs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
    font-size: 0.85em;
}

.cheat-block-refs-label {
    font-weight: 600;
    color: #64748b;
    margin-right: 4px;
}

.cheat-block-ref {
    background: #e0e7ff;
    color: #4338ca;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 500;
    white-space: nowrap;
}

/* Block type variants */
.cheat-block--category {
    border-left: 4px solid #3b82f6;
}

.cheat-block--method {
    border-left: 4px solid #7c3aed;
}

.cheat-block--warning {
    border-left: 4px solid #dc2626;
    background: #fef2f2;
}

.cheat-block--info {
    border-left: 4px solid #10b981;
    background: #f0fdf4;
}

.cheat-block--requirement {
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
}

.cheat-block--detail {
    border-left: 4px solid #06b6d4;
    background: #ecfeff;
}

.cheat-block--condition {
    border-left: 4px solid #8b5cf6;
    background: #faf5ff;
}

.cheat-block--process {
    border-left: 4px solid #ef4444;
    background: #fef2f2;
}

.cheat-block--outcome {
    border-left: 4px solid #14b8a6;
    background: #f0fdfa;
}

.cheat-sheet-panels {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.cheat-sheet-panels-column {
    flex: 1 1 260px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cheat-sheet-panel {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    background: rgba(248, 250, 252, 0.92);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cheat-sheet-panel h3 {
    margin-bottom: 12px;
    color: #0f172a;
    font-size: 1.05em;
}

.cheat-sheet-panel ul {
    list-style: disc;
    padding-left: 20px;
    color: #374151;
}

.cheat-sheet-panel li {
    margin-bottom: 6px;
    line-height: 1.5;
}

.cheat-sheet-panel:focus,
.cheat-sheet-panel:hover {
    border-color: #818cf8;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.15);
    outline: none;
}

.cheat-panel-placeholder {
    color: #9ca3af;
    font-style: italic;
}

.cheat-sheet-footer {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.cheat-sheet-footer h4 {
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6b7280;
    margin-bottom: 8px;
}

.cheat-sheet-notes ul {
    list-style: disc;
    padding-left: 20px;
    color: #374151;
}

.cheat-sheet-references p {
    color: #1f2937;
    font-weight: 600;
}

.cheat-sheet-print-hint {
    font-size: 0.9em;
    color: #6b7280;
    text-align: right;
}

.cheat-sheet-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 30px;
    color: #4b5563;
}

.cheat-sheet-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(79, 70, 229, 0.2);
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@media (max-width: 768px) {
    .cheat-sheet-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cheat-sheet-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .cheat-sheet-print-btn {
        padding: 8px 14px;
        font-size: 0.85em;
    }

    .cheat-sheet-print-text {
        font-size: 0.9em;
    }

    .cheat-sheet-blocks {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cheat-block {
        padding: 16px;
    }

    .cheat-block-title {
        font-size: 1em;
    }

    .cheat-block-items {
        font-size: 0.9em;
    }

    .flip-cards-header h2 {
        font-size: clamp(1.1em, 5vw, 1.4em);
        line-height: 1.3;
        word-break: normal;
    }

    .flip-cards-description {
        font-size: 0.9em;
    }

    .flip-cards-grid {
        grid-template-columns: 1fr;
    }

    .flip-card {
        height: 240px;
    }

    .flip-cards-widget {
        padding: 16px;
    }

    .flip-card--mini .card-side {
        padding: 16px;
    }

    .flip-card-case {
        font-size: 0.95em;
        line-height: 1.25;
        word-break: normal;
        white-space: normal;
    }

    .flip-card-board {
        font-size: 0.7em;
        padding: 2px 8px;
        max-width: 100%;
        white-space: nowrap;
    }

    .flip-card-topic {
        font-size: 0.9em;
    }

    .flip-card-summary {
        font-size: 0.88em;
        line-height: 1.5;
    }

    .flip-card-tags {
        gap: 4px;
    }

    .flip-cards-controls {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 12px;
    }

    .flip-cards-field,
    .flip-cards-reset {
        width: 100%;
        max-width: 360px;
    }

    .flip-cards-field {
        align-items: flex-start;
    }

    .cheat-sheet {
        padding: 20px;
        gap: 18px;
    }

    .cheat-sheet-header {
        align-items: flex-start;
    }

    .cheat-sheet-panels {
        flex-direction: column;
    }

    .cheat-sheet-panels-column {
        flex: 1 1 auto;
    }

    .cheat-sheet-graph {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .flip-cards-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .flip-cards-widget {
        padding: 12px;
    }

    .cheat-sheet {
        padding: 16px;
    }

    .cheat-sheet-graph {
        padding: 12px;
    }
}

/* Mobile responsive for story modules */
@media (max-width: 768px) {
    .story-scene {
        padding: 20px !important;
    }
    
    .story-title {
        font-size: 1.3em !important;
    }
    
    .story-choice-btn {
        padding: 14px 18px !important;
        font-size: 0.95em !important;
    }
    
    .story-text-paragraph {
        font-size: 1em !important;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden; /* Prevent horizontal scroll */
    width: 100%;
    max-width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden; /* Prevent horizontal overflow */
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Very subtle grid pattern - opacity reduced for better readability */
    /* Research shows background patterns should be < 0.1 opacity to not interfere with reading */
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.4; /* Reduced from 0.5 for better text readability */
}

.header-content {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.header-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

header h1 {
    color: white;
    font-size: 2.5em;
    margin-bottom: 16px;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.brand-title {
    font-weight: 700;
    letter-spacing: 0.6px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-title--bar {
    font-size: 1.1em;
    margin-right: 15px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    color: #fff;
}

.brand-title--hero {
    font-size: 1.8em;
    color: #fff;
    margin: 20px 0 10px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 1px;
    width: 100%;
    justify-content: center;
}

.brand-title--footer {
    font-size: 1.4em;
    color: #667eea;
    letter-spacing: 0.5px;
    width: 100%;
    justify-content: center;
    margin-top: 20px;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.3em;
    margin-bottom: 10px;
    font-weight: 500;
}

.description {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
}

.header-stats {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 30px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 100px;
}

.stat-number {
    font-size: 2em;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6), 0 0 12px rgba(255,255,255,0.5);
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: #ffffff;
    background-clip: initial;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    opacity: 1;
}

.stat-label {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.95);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* These styles are now consolidated in the main @media (max-width: 768px) block below */

/* Navigation Styles */
.main-nav {
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.nav-column {
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .nav-column-stories {
        margin-top: 30px;
    }
}

.nav-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Disable hover transforms on touch devices */
@media (hover: hover) and (pointer: fine) {
    .nav-section:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
}

.nav-section h3,
.nav-section-title {
    color: #2c3e50;
    margin-bottom: 18px;
    font-size: 1.15em;
    font-weight: 600;
    border-bottom: 3px solid #3498db;
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    padding: 10px 14px;
    text-decoration: none;
    color: #2c3e50;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.95em;
    cursor: pointer;
    display: block;
    border-left: 3px solid transparent;
    position: relative;
}

.nav-item-expandable {
    margin-bottom: 8px;
}

.nav-link .expand-icon {
    float: right;
    font-size: 0.8em;
    transition: transform 0.3s ease;
    color: #667eea;
}

.nav-link.active .expand-icon {
    transform: rotate(180deg);
}

.nav-widget-container {
    margin-top: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    animation: slideDown 0.3s ease-out;
}

/* Direct widget containers (no inner accordion) */
.direct-widget-container {
    margin-top: 0;
    padding: 15px;
    background: transparent;
    border: none;
}

.direct-widget .accordion-content {
    padding: 0;
}

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

.nav-widget-container .widget {
    margin-bottom: 0;
    box-shadow: none;
}

/* Disable hover transforms on touch devices (prevents "tap causes sideways jump") */
@media (hover: hover) and (pointer: fine) {
    .nav-link:hover {
        background: linear-gradient(90deg, #e3f2fd 0%, #ffffff 100%);
        color: #1976d2;
        transform: translateX(8px);
    }
}

.nav-link:active {
    transform: translateX(4px);
}

.nav-link:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.nav-link.active {
    background: #3498db;
    color: white;
    font-weight: 600;
}

.nav-link-placeholder {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

/* Disable hover transforms on touch devices */
@media (hover: hover) and (pointer: fine) {
    .nav-link-placeholder:hover {
        background: #f5f5f5;
        transform: translateX(4px);
        border-left-color: #95a5a6;
    }
}

.nav-link-placeholder::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 14px;
    width: 6px;
    height: 6px;
    background: #95a5a6;
    border-radius: 50%;
    transform: translateY(-50%);
}

/* Accordion Navigation Styles */
/* Main navigation accordion container - vertical layout */
/* 1. Ana Izgara Yapısını Standartlaştır */
.nav-accordion {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important; /* Her zaman 2 sütun */
    gap: 12px !important;
    width: 100% !important;
}

/* Column containers */
.nav-column {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Spacing between widgets and story modules */
.nav-column-stories {
    margin-top: 40px;
}

/* Inner accordion containers (for Articles, Rules, Tools, Stories) - REMOVED: These were creating nested grids. 
   Now handled by display: contents in the master grid layout at the end of the file. */

.accordion-item {
    background: white;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    /* Ensure accordion items are grid items */
    display: block;
}

.accordion-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.accordion-item.active {
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

/* 2. Tüm ana başlıkları varsayılan olarak YARIM genişliğe zorla */
.nav-accordion > .accordion-item.main-accordion {
    grid-column: span 1 !important; /* Sadece 1 hücre kapla */
    width: 100% !important;
    display: block !important;
}

/* 3. SADECE aktif (expanded) olan başlık tam satır kaplasın */
.nav-accordion > .accordion-item.main-accordion.active {
    grid-column: 1 / -1 !important; /* İlk sütundan son sütuna kadar yayıl */
}

/* 5. Mobilde otomatik olarak tek sütuna düşmesi için */
@media (max-width: 768px) {
    .nav-accordion {
        grid-template-columns: 1fr !important;
    }
}

.accordion-header {
    width: 100%;
    padding: 18px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: none;
    cursor: pointer;
    min-width: 0 !important; /* Grid cell dışına taşmayı önler */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
}

/* Ensure all elements are vertically centered */
.accordion-header > * {
    display: flex;
    align-items: center;
}

/* Override for title-group which uses column layout */
.accordion-header > .accordion-title-group {
    align-items: flex-start;
}

.accordion-header:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #f8f9fa 100%);
    color: #1976d2;
}

.accordion-item.active .accordion-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.accordion-icon {
    font-size: 1.3em;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* 4. İçerik taşmasını önle (Bu çok önemli!) */
.accordion-title-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0 !important;
    gap: 4px;
    margin: 0;
    padding: 0;
}

@media (max-width: 768px) {
    .accordion-title-group {
        gap: 6px;
    }
}

/* For accordions without title-group (legacy support) */
.accordion-header > .accordion-title:not(.accordion-title-group .accordion-title) {
    flex: 1;
    display: block;
    align-self: center;
}

.accordion-title {
    font-weight: 700;
    font-size: 1.15em;
    line-height: 1.3;
    display: block;
    width: 100%;
    color: #2c3e50;
}

.accordion-item.active .accordion-title {
    color: white;
}

.accordion-subtitle {
    font-size: 0.7em;
    font-weight: 400;
    color: #6c757d;
    line-height: 1.5;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    opacity: 0.9;
    max-height: calc(1.5em * 2); /* 2 lines max */
}

.accordion-item.active .accordion-subtitle {
    color: rgba(255, 255, 255, 0.85);
}

.accordion-count {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    min-width: 32px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.accordion-item.active .accordion-count {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.accordion-arrow {
    font-size: 0.9em;
    transition: transform 0.3s ease;
    color: #667eea;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    width: 20px;
    height: 20px;
}

.accordion-item.active .accordion-arrow {
    color: white;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.3s ease, opacity 0.3s ease;
    background: white;
    padding: 0;
    opacity: 0;
}

/* Replace the style-attribute selector with active-class-based rule (much more reliable) */
.accordion-item.active .accordion-content {
    padding: 20px;
    opacity: 1;
    animation: slideDown 0.3s ease-out;
}

.accordion-content .nav-links {
    padding: 0;
}

/* Widget Container */
.widget-container {
    margin-bottom: 30px;
}

.widget {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
    scroll-margin-top: 120px; /* Account for user info bar + header */
}

.widget-container {
    scroll-margin-top: 120px;
}

.widget-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
}

.widget-header h2 {
    margin: 0 0 10px 0;
    font-size: 1.5em;
}

.widget-description {
    margin: 0;
    opacity: 0.9;
    font-size: 1em;
}

.widget-content {
    padding: 25px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.form-actions button {
    flex: 1;
    min-width: 150px;
}

/* Form Styles */
.input-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.input-section h2,
.input-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
}

/* Coming Soon Styles */
.coming-soon {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.coming-soon h3 {
    color: #6c757d;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.coming-soon p {
    color: #6c757d;
    font-size: 1.1em;
}

.date-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    align-items: end;
}

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

.form-group label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.form-group input[type="date"] {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input[type="date"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group small {
    color: #7f8c8d;
    font-size: 0.8em;
    margin-top: 5px;
}

.form-group select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    background: white;
    transition: border-color 0.3s ease;
}

.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Requirements and Consequences Styles */
.requirements-summary,
.consequences-summary {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.requirements-summary h3,
.consequences-summary h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.requirement-item,
.consequence-item {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.requirement-item.required {
    border-left-color: #f39c12;
    background: #fff3cd;
}

.requirement-item.optional {
    border-left-color: #6c757d;
    background: #f8f9fa;
}

.consequence-item.success {
    border-left-color: #27ae60;
    background: #d4edda;
}

.consequence-item.error {
    border-left-color: #e74c3c;
    background: #f8d7da;
}

.consequence-item.warning {
    border-left-color: #f39c12;
    background: #fff3cd;
}

.consequence-item.info {
    border-left-color: #3498db;
    background: #d1ecf1;
}

.requirement-type {
    font-weight: bold;
    color: #2c3e50;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.requirement-description,
.consequence-message {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.requirement-details,
.consequence-detail {
    color: #6c757d;
    font-size: 0.9em;
}

/* Fees Display Styles */
.fees-summary {
    background: #e8f5e8;
    border: 1px solid #c3e6c3;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.fees-summary h3 {
    color: #155724;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.fee-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #c3e6c3;
}

.fee-item:last-child {
    border-bottom: none;
}

.fee-item.total {
    font-weight: bold;
    font-size: 1.1em;
    color: #155724;
    border-top: 2px solid #155724;
    margin-top: 10px;
    padding-top: 15px;
}

.fee-label {
    color: #155724;
    font-weight: 500;
}

.fee-amount {
    color: #155724;
    font-weight: 600;
    font-size: 1.1em;
}

/* Checkbox Group Styling */
.checkbox-group h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1em;
    font-weight: 600;
}

/* Calculations and Statistics Styles */
.calculations-summary,
.stats-summary {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.calculations-summary h3,
.stats-summary h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.calculation-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 2fr;
    gap: 15px;
    padding: 12px;
    margin-bottom: 8px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    align-items: center;
}

.calculation-rule {
    font-weight: bold;
    color: #2c3e50;
    font-size: 0.9em;
}

.calculation-period {
    color: #3498db;
    font-weight: 600;
}

.calculation-date {
    color: #27ae60;
    font-weight: 500;
}

.calculation-description {
    color: #6c757d;
    font-size: 0.9em;
}

.stats-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-label {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.stat-value {
    color: #2c3e50;
    font-size: 1.5em;
    font-weight: bold;
}

.calculate-btn, .reset-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    height: fit-content;
}

.calculate-btn,
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.calculate-btn:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #7a8ff0 0%, #8655c0 100%);
}

.reset-btn,
.btn-secondary {
    background: #1a2446;
    color: #9aa5d0;
    border: 1px solid #2d3a5f;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-btn:hover,
.btn-secondary:hover {
    background: #2d3a5f;
    color: #e8ecff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 36, 70, 0.3);
}

/* Results Section */
.results-section {
    margin-bottom: 30px;
}

.results-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.rule-analysis {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.rule-analysis h3 {
    color: #856404;
    margin-bottom: 15px;
}

.analysis-content {
    color: #856404;
    font-weight: 500;
}

/* Timeline Styles */
.timeline-container {
    margin-bottom: 30px;
}

.timeline-container h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.timeline {
    position: relative;
    height: 80px;
    background: linear-gradient(90deg, #ecf0f1 0%, #bdc3c7 50%, #ecf0f1 100%);
    border-radius: 40px;
    margin: 40px 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    overflow: visible;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: #3498db;
    border-radius: 2px;
    transform: translateY(-50%);
}

.event {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.event:hover {
    transform: translateY(-50%) scale(1.1);
}

.event::before {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    background: #3498db;
    border: 3px solid white;
    border-radius: 50%;
    margin: 0 auto 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.event:hover::before {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.event h4 {
    font-size: 0.9em;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 4px 0;
    white-space: nowrap;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.event p {
    font-size: 0.8em;
    color: #7f8c8d;
    margin: 0;
    background: white;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.event.urgent::before {
    background: #e74c3c;
    animation: pulse 2s infinite;
}

.event.warning::before {
    background: #f39c12;
}

.event.success::before {
    background: #27ae60;
}

.event.info::before {
    background: #3498db;
}

@keyframes sparkle {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 215, 0, 0.5);
        transform: scale(1.02);
    }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

/* Tooltip Styles */
.tooltip {
    position: absolute;
    background: #2c3e50;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9em;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2c3e50;
}

/* Deadlines Summary */
.deadlines-summary {
    background: #e8f5e8;
    border: 1px solid #c3e6c3;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.deadlines-summary h3 {
    color: #155724;
    margin-bottom: 15px;
}

.deadline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #c3e6c3;
}

.deadline-item:last-child {
    border-bottom: none;
}

.deadline-label {
    font-weight: 600;
    color: #155724;
}

.deadline-date {
    color: #155724;
    font-weight: 500;
}

.deadline-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
}

.deadline-status.valid {
    background: #d4edda;
    color: #155724;
}

.deadline-status.invalid {
    background: #f8d7da;
    color: #721c24;
}

.deadline-status.warning {
    background: #fff3cd;
    color: #856404;
}

/* Actions */
.actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.action-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #6c757d;
    color: white;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Help Section */
.help-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 40px 30px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.help-section h2 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2em;
    text-align: center;
    font-weight: 700;
}

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

.help-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.help-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: #3498db;
}

.help-icon {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
}

.help-card h3 {
    color: #2c3e50;
    font-size: 1.2em;
    margin-bottom: 10px;
    font-weight: 600;
}

.help-card p {
    color: #5a6c7d;
    font-size: 0.95em;
    line-height: 1.6;
    margin: 0;
}

.help-cta {
    text-align: center;
    padding-top: 25px;
    border-top: 2px solid #e9ecef;
    margin-top: 20px;
}

.help-cta p {
    color: #34495e;
    font-size: 1.1em;
    font-weight: 500;
    margin: 0;
}

/* Footer Styles */
.site-footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-top: 40px;
    padding: 40px 30px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: white;
    font-size: 1.3em;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.footer-section p {
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.7;
    font-size: 0.95em;
    margin-bottom: 10px;
}

.footer-link {
    color: #ffd700;
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #ffed4e;
    text-decoration: none;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 20px;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9em;
    margin: 0;
}

/* Footer Mobile Responsive */
@media (max-width: 768px) {
    .site-footer {
        padding: 30px 20px 15px;
        margin-top: 30px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .footer-section h3 {
        font-size: 1.2em;
    }
    
    .footer-section p {
        font-size: 0.9em;
    }
}

/* These styles are now consolidated in the main @media (max-width: 768px) block below */

.rule-explanation h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.rule-text p {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.rule-text p::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #3498db;
    font-weight: bold;
}

/* Print Styles */
@media print {
    body {
        background: white;
        font-size: 12pt;
    }
    
    .container {
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
    
    .input-section,
    .actions,
    .help-section {
        display: none;
    }
    
    .timeline {
        background: #f0f0f0;
        border: 2px solid #333;
    }
    
    .timeline::before {
        background: #333;
    }
    
    .event::before {
        background: #333;
        border-color: #000;
    }
    
    .event h4,
    .event p {
        background: white;
        border: 1px solid #333;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 5px;
        padding: 10px;
        border-radius: 8px;
    }
    
    /* User Info Bar Mobile - Using !important to override inline styles */
    .user-info-bar {
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 8px 12px !important;
        font-size: 0.75em !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    .user-info-bar::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    .user-info-left {
        flex-direction: row !important;
        align-items: center !important;
        gap: 6px !important;
        flex-shrink: 0 !important;
        min-width: max-content !important;
    }
    
    .brand-title--bar {
        font-size: clamp(0.95em, 3.8vw, 1.05em) !important;
        margin-right: 0 !important;
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    
    .user-email {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: inline-block !important;
        max-width: 100% !important;
    }
    
    .institution-tag {
        font-size: 0.8em !important;
        padding: 2px 8px !important;
    }
    
    .user-badge {
        font-size: 0.7em !important;
        padding: 2px 8px !important;
        flex-shrink: 0 !important;
    }
    
    .logout-btn {
        flex-shrink: 0 !important;
        padding: 4px 10px !important;
        font-size: 0.75em !important;
        white-space: nowrap !important;
    }
    
    .user-email {
        max-width: 120px !important;
        flex-shrink: 0 !important;
    }
    
    .institution-tag {
        flex-shrink: 0 !important;
    }
    
    /* Header Mobile */
    header {
        padding: 20px 10px;
        margin-bottom: 20px;
    }
    
    header h1 {
        font-size: 1.5em;
        line-height: 1.3;
    }
    
    .header-badge {
        font-size: 0.75em;
        padding: 5px 12px;
        margin-bottom: 15px;
    }
    
    .description {
        font-size: 0.9em;
        margin-bottom: 20px;
    }
    
    /* Prevent EPCSnapshots.com from overflowing on mobile */
    .site-title,
    header p.site-title,
    p.site-title {
        font-size: clamp(1.1em, 6vw, 1.4em) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: block;
        max-width: 100%;
        margin: 18px auto 10px !important;
    }
    
    .user-info-left > span:first-child {
        font-size: 0.9em !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
        max-width: 100%;
        display: inline-block;
        word-break: keep-all !important;
        word-wrap: normal !important;
        hyphens: none !important;
    }
    
    .header-stats {
        gap: 12px;
        margin-top: 15px;
        padding-top: 15px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
        padding-bottom: 8px;
        justify-content: flex-start;
        /* Hide scrollbar but keep functionality */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .header-stats::-webkit-scrollbar {
        display: none;
    }
    
    .stat-item {
        flex-shrink: 0;
        min-width: 90px;
        padding: 8px 4px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        backdrop-filter: blur(4px);
    }
    
    .stat-number {
        font-size: 1.4em;
        line-height: 1.1;
    }
    
    .stat-label {
        font-size: 0.65em;
        line-height: 1.2;
        padding: 0 4px;
    }
    
    /* Navigation Mobile */
    .main-nav {
        padding: 15px;
        gap: 15px;
        grid-template-columns: 1fr;
    }
    
    .nav-section {
        padding: 15px;
    }
    
    .nav-section h3,
    .nav-section-title {
        font-size: 1em;
        margin-bottom: 12px;
    }
    
    .nav-link {
        padding: 12px;
        font-size: 0.9em;
    }
    
    .nav-widget-container {
        padding: 10px;
        margin-top: 5px;
    }
    
    /* Direct widget containers - more compact on mobile */
    .direct-widget-container {
        padding: 8px;
        margin-top: 0;
    }
    
    .direct-widget .accordion-content {
        padding: 0;
    }
    
    .direct-widget .nav-column {
        padding: 8px !important;
        margin-top: 5px !important;
    }
    
    .direct-widget .nav-column p {
        font-size: 0.75em !important;
        margin-bottom: 10px !important;
        padding: 0 5px !important;
    }
    
    /* Mobile: Direct widgets as full-screen modal overlay (like cheat sheets) */
    .direct-widget-mobile-modal {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 999 !important;
        margin: 0 !important;
        background: #ffffff !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .direct-widget-mobile-modal .accordion-content {
        position: relative !important;
        max-height: none !important;
        padding: 60px 16px 20px !important;
        display: block !important;
    }
    
    .direct-widget-mobile-modal .nav-column {
        padding: 0 !important;
        margin-top: 0 !important;
    }
    
    .direct-widget-mobile-modal .direct-widget-container {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Close button for mobile direct widgets */
    /* Default: hidden everywhere */
    .direct-widget-close-btn {
        display: none !important;
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 1000;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: #ffffff;
        border: 2px solid #667eea;
        color: #667eea;
        font-size: 24px;
        font-weight: bold;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        line-height: 1;
    }
    
    /* Show ONLY when the modal is open (you already add this class to body) */
    body.direct-widget-modal-open .direct-widget-close-btn {
        display: flex !important;
    }
    
    .direct-widget-close-btn:hover,
    .direct-widget-close-btn:focus {
        background: #667eea;
        color: #ffffff;
        transform: scale(1.1);
        box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
    }
    
    .direct-widget-close-btn:active {
        transform: scale(0.95);
    }
    
    /* Mobile backdrop overlay for direct widgets */
    .direct-widget-mobile-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        backdrop-filter: blur(2px);
        animation: fadeIn 0.3s ease;
    }
    
    .direct-widget-mobile-backdrop.active {
        display: block;
    }
    
    body.direct-widget-modal-open {
        overflow: hidden;
    }
    
    .nav-item-expandable {
        margin-bottom: 10px;
    }
    
    /* Accordion Mobile */
    .nav-accordion {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 10px;
    }
    
    .accordion-item {
        border-radius: 8px;
    }
    
    .accordion-header {
        padding: 14px 16px;
        font-size: 1em;
        gap: 8px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .accordion-icon {
        font-size: 1.2em;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }
    
    .accordion-title-group {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 6px;
        min-width: 0;
    }
    
    .accordion-title {
        font-size: 1.05em;
        font-weight: 700;
        line-height: 1.3;
        word-break: normal;
        display: block;
        width: 100%;
        color: #2c3e50;
    }
    
    .accordion-item.active .accordion-title {
        color: white;
        font-weight: 700;
    }
    
    .accordion-subtitle {
        font-size: 0.65em;
        font-weight: 400;
        line-height: 1.4;
        color: #6c757d;
        margin-top: 4px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
        opacity: 0.85;
        max-height: calc(1.4em * 2); /* 2 lines max */
    }
    
    .accordion-item.active .accordion-subtitle {
        color: rgba(255, 255, 255, 0.75);
        opacity: 0.9;
    }
    
    .accordion-item.active .accordion-subtitle {
        color: rgba(255, 255, 255, 0.85);
    }
    
    .accordion-count {
        font-size: 0.75em;
        padding: 3px 10px;
        min-width: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        flex-shrink: 0;
        margin-left: auto;
        margin-right: 8px;
    }
    
    .accordion-arrow {
        font-size: 0.8em;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
    
    /* Mobile variant (matches your current mobile padding behavior) */
    .accordion-item.active .accordion-content {
        padding: 15px;
        opacity: 1;
    }
    
    .accordion-content .nav-link {
        padding: 10px 12px;
        font-size: 0.85em;
    }
    
    /* Widget Content Mobile */
    .widget-content {
        padding: 15px;
    }
    
    .widget-header {
        padding: 15px;
    }
    
    .widget-header h2 {
        font-size: 1.2em;
    }
    
    .widget-description {
        font-size: 0.9em;
    }
    
    /* Form Elements Mobile */
    .date-form {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-group {
        width: 100%;
    }
    
    .form-group input[type="date"],
    .form-group select {
        width: 100%;
        padding: 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .input-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .input-section h2,
    .input-section h3 {
        font-size: 1.1em;
        margin-bottom: 15px;
    }
    
    /* Form Actions Mobile */
    .form-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
        padding-top: 20px;
    }
    
    .form-actions button,
    .calculate-btn,
    .reset-btn,
    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 14px 20px;
        font-size: 1em;
    }
    
    .actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .action-btn {
        width: 100%;
    }
    
    /* Timeline Mobile */
    .timeline {
        height: 120px;
        margin: 30px 0;
    }
    
    .event {
        min-width: 60px;
    }
    
    .event h4 {
        font-size: 0.75em;
        padding: 3px 6px;
        white-space: normal;
        max-width: 80px;
    }
    
    .event p {
        font-size: 0.7em;
        padding: 2px 4px;
        white-space: normal;
    }
    
    /* Results and Summary Mobile */
    .requirements-summary,
    .consequences-summary,
    .fees-summary,
    .deadlines-summary,
    .calculations-summary,
    .stats-summary {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .requirement-item,
    .consequence-item {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .calculation-item {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 10px;
    }
    
    .calculation-rule,
    .calculation-period,
    .calculation-date,
    .calculation-description {
        font-size: 0.85em;
    }
    
    /* Help Section Mobile */
    .help-section {
        padding: 20px 15px;
    }
    
    .help-section h2 {
        font-size: 1.5em;
        margin-bottom: 20px;
    }
    
    .help-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .help-card {
        padding: 20px;
    }
    
    .help-icon {
        font-size: 2.5em;
    }
    
    .help-card h3 {
        font-size: 1.1em;
    }
    
    .help-card p {
        font-size: 0.9em;
    }
    
    /* Interactive Timeline Mobile */
    .interactive-timeline-container {
        padding: 8px;
    }
    
    .timeline-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .timeline-legend {
        width: 100%;
        justify-content: flex-start;
        font-size: 11px;
    }
    
    .timeline-zoom-control {
        width: 100%;
    }
    
    .timeline-zoom-slider {
        width: 100%;
        max-width: 100%;
    }
    
    /* Radial Date Wheel Mobile */
    .radial-date-wheel-container {
        margin: 15px 0;
    }
    
    .radial-wheel-svg-wrapper {
        padding: 10px;
    }
    
    .radial-wheel-svg {
        width: 200px !important;
        height: 200px !important;
    }
    
    /* European Date Picker Mobile */
    .european-date-dropdowns {
        flex-direction: column;
        gap: 8px;
    }
    
    .date-select {
        width: 100%;
        min-width: auto;
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Rule 112 Flowchart Mobile */
    .flowchart-container {
        padding: 10px;
    }
    
    .flow-step {
        padding: 15px;
        margin: 15px 0;
    }
    
    .remedy-options {
        grid-template-columns: 1fr;
    }
    
    /* Text adjustments */
    p {
        font-size: 0.95em;
        line-height: 1.6;
    }
    
    h2 {
        font-size: 1.3em;
    }
    
    h3 {
        font-size: 1.1em;
    }
    
    /* Prevent text overflow */
    * {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Ensure images and SVGs don't overflow */
    img, svg {
        max-width: 100%;
        height: auto;
    }
    
    /* Table responsiveness */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Extra Small Devices (phones, 480px and down) */
@media (max-width: 480px) {
    .container {
        margin: 0;
        padding: 8px;
        border-radius: 0;
    }
    
    header {
        padding: 15px 8px;
        border-radius: 8px;
    }
    
    header h1 {
        font-size: 1.3em;
    }
    
    .header-badge {
        font-size: 0.7em;
        padding: 4px 10px;
    }
    
    .description {
        font-size: 0.85em;
    }
    
    .header-stats {
        gap: 10px;
        padding-top: 15px;
    }
    
    .stat-number {
        font-size: 1.3em;
    }
    
    .stat-label {
        font-size: 0.65em;
    }
    
    .user-info-bar {
        padding: 8px 10px !important;
        font-size: 0.8em !important;
    }
    
    /* Ensure EPCSnapshots.com displays fully on very small screens */
    .site-title,
    header p.site-title,
    p.site-title {
        font-size: clamp(1em, 7vw, 1.2em) !important;
    }
    
    .brand-title--bar {
        font-size: clamp(0.85em, 4.5vw, 0.95em) !important;
    }
    
    .brand-title--footer {
        font-size: clamp(0.95em, 4.5vw, 1.1em);
    }
    
    .user-info-left > span:first-child {
        font-size: 0.85em !important;
        overflow: visible !important;
        text-overflow: clip !important;
        white-space: nowrap !important;
        word-break: keep-all !important;
        word-wrap: normal !important;
        hyphens: none !important;
    }
    
    .main-nav {
        padding: 10px;
        gap: 10px;
    }
    
    .widget-content {
        padding: 12px;
    }
    
    .widget-header {
        padding: 12px;
    }
    
    .widget-header h2 {
        font-size: 1.1em;
    }
    
    .input-section {
        padding: 12px;
    }
    
    .help-section {
        padding: 15px 10px;
    }
    
    .help-section h2 {
        font-size: 1.3em;
    }
    
    .radial-wheel-svg {
        width: 180px !important;
        height: 180px !important;
    }
    
    .timeline {
        height: 140px;
    }
    
    .event h4 {
        font-size: 0.7em;
        max-width: 70px;
    }
    
    .event p {
        font-size: 0.65em;
    }
}

/* Rule 112 Flowchart Styling */
.flowchart-container {
    max-width: 800px;
    margin: 0 auto;
}

.flowchart {
    position: relative;
    min-height: 400px;
}

.flow-step {
    background: white;
    border: 2px solid #0078d7;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.flow-step.start {
    background: linear-gradient(135deg, #0078d7, #106ebe);
    color: white;
    border-color: #106ebe;
}

.flow-step.result {
    background: #f8f9fa;
    border-color: #28a745;
}

.flow-step.result h4 {
    color: #28a745;
}

.flow-step.remedies {
    background: #fff3cd;
    border-color: #ffc107;
}

.flow-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.flow-btn {
    background: #0078d7;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.flow-btn:hover {
    background: #106ebe;
}

.remedy-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.remedy-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.remedy-card h5 {
    color: #0078d7;
    margin: 0 0 10px 0;
}

.remedy-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
}

.remedy-btn:hover {
    background: #218838;
}

/* Interactive SVG Timeline Styles */
.interactive-timeline-container {
    margin: 20px 0;
    background: #1a2332;
    border: 1px solid #2a3545;
    border-radius: 12px;
    padding: 10px;
}

.timeline-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 15px;
}

.timeline-legend {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    color: #9aa5d0;
    flex-wrap: wrap;
}

.timeline-legend-chip {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.timeline-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.timeline-zoom-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-zoom-control label {
    color: #9aa5d0;
    font-size: 12px;
}

.timeline-zoom-slider {
    width: 120px;
    cursor: pointer;
}

.timeline-scroll-container {
    width: 100%;
    padding: 8px 0;
    background: #1a2332;
    border-top: 1px solid #2a3545;
    display: block;
}

.timeline-scroll-control {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0 20px;
}

.timeline-scroll-slider {
    width: 100%;
    max-width: 100%;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    outline: none;
    height: 20px;
}

.timeline-scroll-slider::-webkit-slider-track {
    background: #3a4a5a;
    height: 4px;
    border-radius: 2px;
}

.timeline-scroll-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #4a90e2;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -5px;
    transition: background 0.2s ease;
}

.timeline-scroll-slider::-webkit-slider-thumb:hover {
    background: #6ba0f2;
}

.timeline-scroll-slider::-moz-range-track {
    background: #3a4a5a;
    height: 4px;
    border-radius: 2px;
}

.timeline-scroll-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #4a90e2;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
}

.timeline-scroll-slider::-moz-range-thumb:hover {
    background: #6ba0f2;
}

.timeline-print-btn {
    background: #242f3f;
    border: 1px solid #2a3545;
    color: #e8f0f7;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.timeline-print-btn:hover {
    background: #2a3b6e;
}

.timeline-svg-wrap {
    position: relative;
    overflow: auto;
    border-radius: 8px;
    background: #1a2332;
    min-height: 240px;
}

.timeline-svg {
    width: 100%;
    min-height: 240px;
    display: block;
    background: linear-gradient(0deg, transparent 49%, #2a3a4a 50%, transparent 51%);
}

.timeline-tooltip {
    position: absolute;
    pointer-events: none;
    background: #242f3f;
    border: 1px solid #2a3b6e;
    color: #e8ecff;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    transform: translate(-50%, -120%);
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.timeline-tooltip b {
    display: block;
    margin-bottom: 4px;
}

.timeline-tooltip small {
    display: block;
    color: #9aa5d0;
    margin-top: 4px;
}

/* SVG Timeline Elements */
.timeline-svg .lane-label {
    fill: #9aa5d0;
    font-size: 12px;
}

.timeline-svg .lane-rule {
    stroke: #3a4a5a;
    stroke-width: 1;
    stroke-dasharray: 4 4;
}

.timeline-svg .grid-line {
    stroke: #2a3a4a;
    stroke-width: 1;
}

.timeline-svg .event-marker,
.timeline-svg .rule-marker {
    cursor: pointer;
    transition: r 0.2s;
}

.timeline-svg .event-marker:hover,
.timeline-svg .rule-marker:hover {
    r: 8;
}

.timeline-svg .window {
    cursor: pointer;
    transition: opacity 0.2s;
}

.timeline-svg .window:hover {
    opacity: 0.4;
}

.timeline-svg .event-label,
.timeline-svg .window-label,
.timeline-svg .rule-label {
    fill: #e8ecff;
    font-size: 12px;
    pointer-events: none;
}

/* Light Theme Support */
.interactive-timeline-container.light-theme {
    background: #ffffff;
    border: 1px solid #dee2e6;
}

.interactive-timeline-container.light-theme .timeline-svg-wrap {
    background: #f8f9fa;
}

.interactive-timeline-container.light-theme .timeline-tooltip {
    background: #ffffff;
    border: 1px solid #dee2e6;
    color: #2c3e50;
}

@media print {
    /* Reset everything for print - remove complex styles */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
        background-image: none !important;
        filter: none !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
    }

    /* Remove all gradients and complex backgrounds */
    .cheat-block,
    .cheat-sheet,
    .cheat-sheet-header,
    .cheat-block-header {
        background: #ffffff !important;
        background-image: none !important;
    }

    html, body {
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        font-size: 12pt !important;
    }

    body::before {
        content: 'EPCSnapshots.com';
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(-45deg);
        font-size: 48px;
        font-weight: 700;
        color: rgba(102, 126, 234, 0.08);
        z-index: 0;
        pointer-events: none;
        white-space: nowrap;
    }

    /* Hide navigation and other page elements */
    header,
    .main-nav,
    .help-section,
    .site-footer,
    .user-info-bar,
    .cheat-sheet-print-btn,
    .cheat-sheet-print-hint {
        display: none !important;
    }

    /* Show only the cheat sheet content */
    .container {
        margin: 0 !important;
        padding: 20px !important;
        width: 100% !important;
        max-width: 100% !important;
        background: #ffffff !important;
        box-shadow: none !important;
    }

    .widget-container,
    #widget-mount,
    .widget {
        display: block !important;
        width: 100% !important;
        background: #ffffff !important;
    }

    .cheat-sheet {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 20px !important;
        background: #ffffff !important;
        color: #000000 !important;
        border: 1px solid #000000 !important;
        page-break-inside: avoid;
    }

    .cheat-sheet-header,
    .cheat-sheet-body,
    .cheat-sheet-footer {
        display: block !important;
        color: #000000 !important;
        background: transparent !important;
    }

    .cheat-sheet-header h2 {
        color: #000000 !important;
        font-size: 18pt !important;
        margin: 0 0 10pt 0 !important;
    }

    .cheat-sheet-header p {
        color: #000000 !important;
        font-size: 10pt !important;
    }

    .cheat-sheet-print-hint {
        display: none;
    }

    .cheat-sheet-print-btn {
        display: none !important;
    }

    .cheat-sheet-header,
    .cheat-sheet-body,
    .cheat-sheet-footer {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .cheat-sheet-blocks {
        display: block !important;
        width: 100% !important;
    }

    .cheat-block {
        display: block !important;
        width: 100% !important;
        margin: 0 0 15pt 0 !important;
        padding: 12pt !important;
        border: 1px solid #000000 !important;
        background: #ffffff !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .cheat-block-header {
        display: block !important;
        margin-bottom: 8pt !important;
    }

    .cheat-block-icon {
        display: inline !important;
    }

    .cheat-block-title {
        display: block !important;
        color: #000000 !important;
        font-size: 12pt !important;
        font-weight: bold !important;
        margin: 0 0 8pt 0 !important;
    }

    .cheat-block-content {
        display: block !important;
    }

    .cheat-block-items {
        display: block !important;
        margin: 0 !important;
        padding-left: 20pt !important;
        color: #000000 !important;
        font-size: 10pt !important;
    }

    .cheat-block-items li {
        display: list-item !important;
        color: #000000 !important;
        margin-bottom: 4pt !important;
    }

    .cheat-block-refs {
        display: block !important;
        margin-top: 8pt !important;
        padding-top: 8pt !important;
        border-top: 1px solid #000000 !important;
        font-size: 9pt !important;
        color: #000000 !important;
    }

    .cheat-block-ref {
        display: inline !important;
        color: #000000 !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
    }

    .cheat-sheet-footer {
        display: block !important;
        margin-top: 20pt !important;
        padding-top: 15pt !important;
        border-top: 1px solid #000000 !important;
        color: #000000 !important;
    }

    .cheat-sheet-footer h4 {
        color: #000000 !important;
        font-size: 11pt !important;
    }

    .cheat-sheet-footer ul,
    .cheat-sheet-footer p {
        color: #000000 !important;
        font-size: 10pt !important;
    }
}

/* Print Styles for Timeline */
@media print {
    .interactive-timeline-container {
        background: #fff;
        border: 1px solid #000;
        page-break-inside: avoid;
    }
    
    .timeline-toolbar,
    .timeline-print-btn {
        display: none !important;
    }
    
    .timeline-tooltip {
        display: none !important;
    }
    
    .timeline-svg {
        background: #f0f0f0;
    }
}

/* Responsive Timeline */
/* These styles are now consolidated in the main @media (max-width: 768px) block below */

/* European Date Picker Styles */
.european-date-label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.european-date-label .required {
    color: #e74c3c;
}

.european-date-picker-wrapper {
    display: flex;
    flex-direction: column;
}

.european-date-dropdowns {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.date-select {
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    background: white;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    font-family: inherit;
}

.date-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.date-select:hover {
    border-color: #3498db;
}

.day-select {
    min-width: 70px;
}

.month-select {
    min-width: 140px;
    flex: 1;
}

.year-select {
    min-width: 90px;
}

.date-select option {
    padding: 8px;
}

.date-select option[disabled] {
    color: #95a5a6;
    font-style: italic;
}

/* Date format helper text */
.date-format-hint {
    font-size: 0.75em;
    color: #7f8c8d;
    margin-top: 4px;
    font-style: italic;
}

/* Responsive date picker */
/* These styles are now consolidated in the main @media (max-width: 768px) block below */

/* Radial Date Wheel Styles */
.radial-date-wheel-container {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.radial-wheel-label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 0.9em;
    text-align: center;
}

.radial-wheel-label .required {
    color: #e74c3c;
}

.radial-wheel-svg-wrapper {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #1a2332 0%, #242f3f 100%);
    border-radius: 50%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 0 40px rgba(74, 144, 226, 0.1);
    border: 2px solid #2a3545;
    transition: all 0.3s ease;
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

.radial-wheel-svg-wrapper:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4), inset 0 0 60px rgba(90, 163, 255, 0.15);
    border-color: #2a3b6e;
}

.radial-wheel-svg {
    cursor: grab;
    user-select: none;
    transition: transform 0.1s ease;
    overflow: hidden;
    display: block;
}

.radial-wheel-svg:active {
    cursor: grabbing;
}

.radial-wheel-svg .ring {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.radial-wheel-svg .ring-circle {
    transition: all 0.3s ease;
}

.radial-wheel-svg .ring-tick {
    transition: stroke-width 0.2s ease;
}

.radial-wheel-svg .ring-label {
    pointer-events: none;
    transition: font-size 0.2s ease, fill 0.2s ease;
}

.radial-wheel-svg .ring-click-area {
    transition: r 0.2s ease;
}

.radial-wheel-svg .ring-click-area:hover {
    r: 18;
    fill: rgba(90, 163, 255, 0.1);
}

.radial-wheel-svg .ring-active-arc {
    transition: opacity 0.3s ease;
    filter: drop-shadow(0 0 4px currentColor);
}

.radial-wheel-svg .wheel-center {
    transition: all 0.3s ease;
    fill: #242f3f !important; /* Lighter panel color instead of darkest bg */
    stroke: #3a4a5a !important; /* Lighter border for visibility */
}

.radial-wheel-svg .wheel-date-label {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    fill: #ffffff !important; /* Force white for maximum contrast */
    font-weight: 700 !important;
    font-size: 14px !important;
}

.radial-wheel-svg-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: #5aa3ff;
    border-radius: 50%;
    box-shadow: 0 0 8px #5aa3ff;
    z-index: 10;
    pointer-events: none;
}

/* Glow effect on active ring */
.radial-wheel-svg .ring[data-ring-id="year"]:hover .ring-circle {
    filter: drop-shadow(0 0 12px #5aa3ff);
}

.radial-wheel-svg .ring[data-ring-id="month"]:hover .ring-circle {
    filter: drop-shadow(0 0 12px #5bd897);
}

.radial-wheel-svg .ring[data-ring-id="day"]:hover .ring-circle {
    filter: drop-shadow(0 0 12px #ffbf5a);
}

/* Responsive adjustments */
/* These styles are now consolidated in the main @media (max-width: 768px) block below */

/* Print styles */
@media print {
    .radial-date-wheel-container {
        break-inside: avoid;
    }
    
    .radial-wheel-svg-wrapper {
        background: white;
        border: 2px solid #000;
        box-shadow: none;
    }
    
    .radial-wheel-svg .ring-active-arc {
        opacity: 1 !important;
    }
}

/* Animation for date updates */
@keyframes datePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.radial-wheel-svg .wheel-date-label.updating {
    animation: datePulse 0.3s ease;
}

/* Ring Handle Styles */
.radial-wheel-svg .ring-handle {
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.radial-wheel-svg .ring-handle rect {
    transition: all 0.2s ease;
}

.radial-wheel-svg .ring.active .ring-handle {
    opacity: 1 !important;
    animation: handlePulse 1.5s ease-in-out infinite;
}

@keyframes handlePulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.radial-wheel-svg .handle-label {
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Ensure each ring rotates independently around its center */
.radial-wheel-svg .ring {
    transform-origin: center center;
    transform-box: fill-box;
}

/* Active ring visual feedback */
.radial-wheel-svg .ring.active .ring-circle {
    opacity: 0.9 !important;
    stroke-width: 4 !important;
    animation: ringPulse 2s ease-in-out infinite;
}

@keyframes ringPulse {
    0%, 100% { filter: drop-shadow(0 0 8px currentColor); }
    50% { filter: drop-shadow(0 0 16px currentColor); }
}

/* Year selector popup styles */
.year-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 16, 32, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    animation: fadeInCheat 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.year-selector-popup {
    background: #121a33;
    border: 2px solid #1a2446;
    border-radius: 12px;
    padding: 20px;
    min-width: 320px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    animation: slideUp 0.3s ease;
}

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

.year-selector-title {
    color: #e8ecff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.year-selector-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.year-selector-btn {
    padding: 12px 8px;
    background: #0b1020;
    border: 1px solid #1a2446;
    border-radius: 6px;
    color: #e8ecff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: inherit;
}

.year-selector-btn:hover {
    background: #1a2446;
    border-color: #5aa3ff;
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(90, 163, 255, 0.3);
}

.year-selector-btn:active {
    transform: scale(0.95);
}

.year-selector-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #9aa5d0;
    font-size: 28px;
    cursor: pointer;
    width: 35px;
    height: 35px;
    line-height: 35px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.year-selector-close:hover {
    background: #1a2446;
    color: #e8ecff;
    transform: rotate(90deg);
}

/* Accessibility */
.radial-wheel-svg:focus {
    outline: 3px solid #5aa3ff;
    outline-offset: 4px;
}

.radial-wheel-svg .ring-label:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Status Indicator for Article 76 */
.status-indicator {
    margin: 20px 0;
    padding: 20px;
    background: #121a33;
    border-radius: 8px;
    border: 1px solid #1a2446;
}

.status-bar {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.status-text {
    color: #e8ecff;
    font-size: 1em;
    line-height: 1.5;
    text-align: center;
}

/* Cheat Sheet Controls */
.cheat-sheets-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    align-items: end;
    padding: 0 10px;
    flex-wrap: wrap;
}

.cheat-sheets-controls .cheat-sheets-field {
    flex: 1;
    min-width: 200px;
}

.cheat-sheets-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9em;
    color: #5a6c7d;
}

.cheat-sheets-field span {
    font-weight: 600;
}

.cheat-sheets-field input,
.cheat-sheets-field select {
    padding: 10px 12px;
    border: 1px solid #dfe3ea;
    border-radius: 8px;
    font-size: 1em;
    transition: border 0.2s ease, box-shadow 0.2s ease;
    background-color: #fff;
}

.cheat-sheets-field input:focus,
.cheat-sheets-field select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102,126,234,0.2);
    outline: none;
}

.cheat-sheets-reset {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #dfe3ea;
    background: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #2c3e50;
}

.cheat-sheets-reset:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f8f9ff;
}

.cheat-sheets-stats {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 16px;
    padding: 0 10px;
    font-size: 0.95em;
}

/* Cheat Sheet Preview Grid */
.cheat-sheets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.cheat-sheet-preview-card {
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cheat-sheet-preview-card:hover {
    transform: translateY(-6px);
}

.cheat-sheet-preview-inner {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
    border: 1px solid #e5e7eb;
    aspect-ratio: 210 / 297; /* A4 ratio */
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Subtle random tint colors for cards */
.cheat-sheet-preview-card:nth-child(6n+1) .cheat-sheet-preview-inner {
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
}

.cheat-sheet-preview-card:nth-child(6n+2) .cheat-sheet-preview-inner {
    background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%);
}

.cheat-sheet-preview-card:nth-child(6n+3) .cheat-sheet-preview-inner {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.cheat-sheet-preview-card:nth-child(6n+4) .cheat-sheet-preview-inner {
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

.cheat-sheet-preview-card:nth-child(6n+5) .cheat-sheet-preview-inner {
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
}

.cheat-sheet-preview-card:nth-child(6n+6) .cheat-sheet-preview-inner {
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

/* Subtle random tint colors for Alternative PCT Articles */
.pct-article-card:nth-child(6n+1) {
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%) !important;
}

.pct-article-card:nth-child(6n+2) {
    background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%) !important;
}

.pct-article-card:nth-child(6n+3) {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%) !important;
}

.pct-article-card:nth-child(6n+4) {
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%) !important;
}

.pct-article-card:nth-child(6n+5) {
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%) !important;
}

.pct-article-card:nth-child(6n+6) {
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%) !important;
}

/* Subtle random tint colors for Alternative PCT Rules */
.pct-rule-card:nth-child(6n+1) {
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%) !important;
}

.pct-rule-card:nth-child(6n+2) {
    background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%) !important;
}

.pct-rule-card:nth-child(6n+3) {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%) !important;
}

.pct-rule-card:nth-child(6n+4) {
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%) !important;
}

.pct-rule-card:nth-child(6n+5) {
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%) !important;
}

.pct-rule-card:nth-child(6n+6) {
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%) !important;
}

.cheat-sheet-preview-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cheat-sheet-preview-card:hover .cheat-sheet-preview-inner {
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.15), 0 4px 12px rgba(15, 23, 42, 0.1);
    border-color: #667eea;
    transform: translateY(-2px);
}

.cheat-sheet-preview-card:hover .cheat-sheet-preview-inner::before {
    opacity: 1;
}

.cheat-sheet-preview-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 10px;
}

.cheat-sheet-preview-icon {
    font-size: 1.4em;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.cheat-sheet-preview-title {
    font-size: 0.9em;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.01em;
}

.cheat-sheet-preview-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}

.cheat-sheet-preview-ref {
    font-size: 0.78em;
    font-weight: 600;
    color: #667eea;
    line-height: 1.3;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.cheat-sheet-preview-desc {
    font-size: 0.72em;
    color: #6b7280;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cheat-sheet-preview-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.cheat-sheet-preview-tag {
    font-size: 0.68em;
    color: #667eea;
    background: linear-gradient(135deg, #e0e7ff 0%, #f0f4ff 100%);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #c7d2fe;
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* Expanded Full View */
.cheat-sheet-preview-card.expanded {
    grid-column: 1 / -1;
    margin: 20px 0;
}

.cheat-sheet-preview-card.expanded .cheat-sheet-preview-inner {
    display: none;
}

.cheat-sheet-preview-card.expanded .cheat-sheet-full-view {
    display: block !important;
}

.cheat-sheet-full-view {
    width: 100%;
    animation: fadeIn 0.3s ease;
    position: relative;
}

/* Close button for mobile */
.cheat-sheet-close-btn {
    display: none; /* Hidden on desktop by default */
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #667eea;
    color: #667eea;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.cheat-sheet-close-btn:hover,
.cheat-sheet-close-btn:focus {
    background: #667eea;
    color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

.cheat-sheet-close-btn:active {
    transform: scale(0.95);
}

/* Mobile backdrop overlay */
.cheat-sheet-mobile-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    backdrop-filter: blur(2px);
    animation: fadeIn 0.3s ease;
}

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

/* Mobile adjustments */
@media (max-width: 768px) {
    .cheat-sheets-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 0;
    }
    
    .cheat-sheets-controls .cheat-sheets-field {
        min-width: auto;
        width: 100%;
    }
    
    .cheat-sheets-reset {
        width: 100%;
    }
    
    .cheat-sheets-field {
        align-items: flex-start;
    }
    
    .cheat-sheets-stats {
        padding: 0;
        text-align: center;
    }
    
    .cheat-sheets-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
        padding: 15px 0;
    }
    
    .cheat-sheet-preview-inner {
        padding: 14px;
    }
    
    .cheat-sheet-preview-title {
        font-size: 0.82em;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
    
    .cheat-sheet-preview-desc {
        font-size: 0.68em;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
    
    /* Mobile: Expanded cheat sheet as modal overlay */
    .cheat-sheet-preview-card.expanded {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 999;
        margin: 0;
        grid-column: unset;
        background: #ffffff;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 60px 16px 20px;
    }
    
    .cheat-sheet-mobile-backdrop.active {
        display: block;
    }
    
    .cheat-sheet-close-btn {
        display: flex !important;
    }
    
    .cheat-sheet-full-view {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .cheat-sheet-full-view .cheat-sheet {
        padding: 20px 16px;
        border-radius: 0;
        margin: 0;
        box-shadow: none;
    }
    
    .cheat-sheet-full-view .cheat-sheet-header {
        margin-bottom: 20px;
    }
    
    .cheat-sheet-full-view .cheat-sheet-header h2 {
        font-size: 1.4em;
    }
    
    .cheat-sheet-full-view .cheat-sheet-blocks {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Prevent body scroll when modal is open */
    body.cheat-sheet-modal-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}

/* Question Generator Styles */
.question-generator-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
}

.question-generator-header {
    text-align: center;
    margin-bottom: 30px;
}

.question-generator-header h2 {
    font-size: 2em;
    color: #2c3e50;
    margin-bottom: 10px;
}

.question-generator-subtitle {
    color: #ffffff;
    font-size: 1em;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    opacity: 0.95;
}

.question-generator-loading {
    text-align: center;
    padding: 40px;
    color: #667eea;
}

.question-generator-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e0e7ff;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.question-generator-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* Make controls section more prominent on desktop */
@media (min-width: 769px) {
    .question-generator-controls {
        gap: 25px;
        margin-bottom: 40px;
    }
}

.question-generator-difficulty {
    display: flex;
    align-items: center;
    gap: 10px;
}

.question-generator-difficulty label {
    font-weight: 600;
    color: #374151;
}

.question-generator-difficulty select {
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.question-generator-difficulty select:focus {
    outline: none;
    border-color: #667eea;
}

.question-generator-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Make button more prominent on web (desktop) only */
@media (min-width: 769px) {
    .question-generator-btn {
        padding: 22px 40px !important;
        font-size: 1.3em !important;
        font-weight: 700 !important;
        border-radius: 14px !important;
        box-shadow: 0 8px 28px rgba(102, 126, 234, 0.5), 0 0 0 2px rgba(102, 126, 234, 0.1) !important;
        letter-spacing: 0.5px !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        min-width: 320px !important;
        text-transform: none !important;
        position: relative !important;
    }
    
    .question-generator-btn::before {
        content: '';
        position: absolute;
        top: -2px;
        left: -2px;
        right: -2px;
        bottom: -2px;
        background: linear-gradient(135deg, #667eea, #764ba2, #f59e0b);
        border-radius: 16px;
        z-index: -1;
        opacity: 0.3;
        filter: blur(8px);
    }
    
    .question-generator-btn:hover:not(:disabled) {
        transform: translateY(-4px) scale(1.02) !important;
        box-shadow: 0 12px 36px rgba(102, 126, 234, 0.6), 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
        background: linear-gradient(135deg, #7c8ef0 0%, #8a5fb8 100%) !important;
    }
    
    .question-generator-btn:active:not(:disabled) {
        transform: translateY(-2px) scale(1.01) !important;
    }
}

.question-generator-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.question-generator-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #9ca3af;
}

.question-display {
    margin-bottom: 30px;
}

.question-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.question-header {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.question-type-badge {
    padding: 6px 12px;
    background: #e0e7ff;
    color: #667eea;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: capitalize;
}

.question-difficulty-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: capitalize;
}

.difficulty-easy {
    background: #d1fae5;
    color: #065f46;
}

.difficulty-medium {
    background: #fef3c7;
    color: #92400e;
}

.difficulty-hard {
    background: #fee2e2;
    color: #991b1b;
}

.scenario-badge {
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
    }
}

.question-card.scenario-based {
    border-left: 4px solid #667eea;
    background: linear-gradient(to right, rgba(102, 126, 234, 0.02), transparent);
}

.question-text {
    font-size: 1.2em;
    font-weight: 600;
    color: #111827;
    margin-bottom: 25px;
    line-height: 1.6;
}

.question-card.scenario-based .question-text {
    font-size: 1.15em;
    line-height: 1.7;
    color: #1f2937;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.question-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #f9fafb;
}

.question-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.question-option input[type="radio"],
.question-option input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.option-label {
    font-weight: 700;
    color: #667eea;
    min-width: 28px;
    flex-shrink: 0;
    text-align: center;
}

.option-text {
    flex: 1;
    color: #374151;
    line-height: 1.5;
}

.question-fill-blank {
    margin-bottom: 25px;
}

.question-fill-blank input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1.1em;
    margin-bottom: 15px;
}

.question-fill-blank input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.fill-blank-suggestions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.suggestion-btn {
    padding: 8px 16px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.suggestion-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.question-ordering {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.ordering-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: move;
    transition: all 0.2s;
}

.ordering-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.ordering-item.dragging {
    opacity: 0.5;
}

.order-handle {
    font-size: 1.2em;
    color: #9ca3af;
    cursor: grab;
}

.order-handle:active {
    cursor: grabbing;
}

.order-text {
    flex: 1;
    color: #374151;
}

.question-matching {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.matching-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    flex-wrap: wrap;
}

.matching-item {
    flex: 1;
    min-width: 200px;
    color: #374151;
    line-height: 1.5;
}

.matching-select {
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    min-width: 200px;
}

.matching-select:focus {
    outline: none;
    border-color: #667eea;
}

/* Dropdown Question Styles */
.question-dropdown {
    margin-bottom: 25px;
}

.dropdown-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1.1em;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.dropdown-select:hover {
    border-color: #667eea;
}

.dropdown-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Tabular Question Styles */
.question-tabular {
    margin-bottom: 25px;
    overflow-x: auto;
}

.tabular-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tabular-table thead {
    background: #667eea;
    color: white;
}

.tabular-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
}

.tabular-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s;
}

.tabular-table tbody tr:hover {
    background: #f9fafb;
}

.tabular-table td {
    padding: 12px 15px;
}

.tabular-input-wrapper {
    position: relative;
    width: 100%;
}

.tabular-input-wrapper:focus-within .tabular-tooltip,
.tabular-input-wrapper:hover .tabular-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tabular-tooltip {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    min-width: 220px;
    max-width: 360px;
    background: #111827;
    color: #f9fafb;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
    font-size: 0.85em;
    line-height: 1.4;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 10;
}

.tabular-tooltip::after {
    content: '';
    position: absolute;
    left: 16px;
    top: 100%;
    border-width: 6px;
    border-style: solid;
    border-color: #111827 transparent transparent transparent;
}

.tabular-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9em;
    transition: all 0.2s;
}

.tabular-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Rating Question Styles */
.question-rating {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.rating-item {
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.rating-item-label {
    font-weight: 600;
    margin-bottom: 12px;
    color: #374151;
}

.rating-scale {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.rating-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.rating-option:hover {
    background: #f0f4ff;
}

.rating-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.rating-value {
    font-weight: 600;
    font-size: 1.1em;
    color: #667eea;
}

.rating-label {
    font-size: 0.75em;
    color: #6b7280;
    text-align: center;
    max-width: 80px;
}

/* Rank Order Question Styles */
.question-rank-order {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.rank-order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: move;
    transition: all 0.2s;
}

.rank-order-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.rank-order-item.dragging {
    opacity: 0.5;
}

.rank-handle {
    font-size: 1.2em;
    color: #9ca3af;
    cursor: grab;
}

.rank-handle:active {
    cursor: grabbing;
}

.rank-text {
    flex: 1;
    color: #374151;
}

.rank-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9em;
    min-width: 120px;
    background: white;
    cursor: pointer;
}

.rank-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Matrix Question Styles */
.question-matrix {
    margin-bottom: 25px;
    overflow-x: auto;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.matrix-table thead {
    background: #667eea;
    color: white;
}

.matrix-table th {
    padding: 12px 15px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95em;
}

.matrix-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s;
}

.matrix-table tbody tr:hover {
    background: #f9fafb;
}

.matrix-table td {
    padding: 12px 15px;
    text-align: center;
}

.matrix-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.matrix-table input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

/* Responsive styles for new question types */
@media (max-width: 768px) {
    .tabular-table,
    .matrix-table {
        font-size: 0.9em;
    }
    
    .tabular-table th,
    .tabular-table td,
    .matrix-table th,
    .matrix-table td {
        padding: 8px 10px;
    }
    
    .rating-scale {
        justify-content: center;
    }
    
    .rating-option {
        flex: 0 0 auto;
    }
    
    .matching-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .matching-select {
        width: 100%;
        min-width: auto;
    }
    
    .rank-order-item {
        flex-wrap: wrap;
    }
    
    .rank-select {
        width: 100%;
        margin-top: 10px;
    }
}

.question-actions {
    text-align: center;
    margin-top: 25px;
}

.question-submit-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.question-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.question-feedback {
    margin-top: 30px;
}

.feedback-card {
    padding: 25px;
    border-radius: 12px;
    border: 2px solid;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.feedback-correct {
    background: #f0fdf4;
    border-color: #10b981;
}

.feedback-incorrect {
    background: #fef2f2;
    border-color: #ef4444;
}

/* Chat Floating Button */
.chat-floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    color: white;
    font-size: 1.8em;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-floating-btn:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
}

.chat-floating-btn:active {
    transform: translateY(-2px) scale(1.05);
}

.chat-floating-btn.has-unread::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border: 2px solid white;
    border-radius: 50%;
}

/* Mobile Responsiveness for Chat */
@media (max-width: 768px) {
    .chat-widget {
        height: 500px;
        padding: 15px;
    }

    .chat-avatar-selector {
        grid-template-columns: repeat(5, 1fr);
    }

    .chat-message {
        max-width: 85%;
    }

    .chat-floating-btn {
        display: none !important; /* Hide floating button on mobile */
    }
}

.feedback-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.feedback-icon {
    font-size: 1.5em;
}

.feedback-explanation {
    margin-bottom: 15px;
    color: #374151;
    line-height: 1.6;
}

.feedback-sources {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.feedback-sources strong {
    display: block;
    margin-bottom: 8px;
    color: #374151;
}

.feedback-sources ul {
    margin: 0;
    padding-left: 20px;
    color: #6b7280;
}

.feedback-sources li {
    margin-bottom: 5px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .question-generator-container {
        padding: 20px 15px;
        text-align: center;
    }

    .question-generator-header {
        text-align: center;
    }

    .question-generator-controls {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .question-generator-difficulty {
        justify-content: center;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .question-generator-difficulty label {
        white-space: nowrap;
        text-align: center;
        font-size: 0.95em;
        min-width: fit-content;
        flex-shrink: 0;
    }

    .question-generator-difficulty select {
        flex: 1;
        min-width: 0;
        max-width: 200px;
        text-align: center;
        text-align-last: center;
        font-size: 0.95em;
        padding: 10px 12px;
    }

    .question-generator-btn {
        width: 100%;
        max-width: 300px;
    }

    .question-card {
        padding: 20px;
    }

    .question-text {
        font-size: 1.1em;
    }

    .matching-row {
        flex-direction: column;
        align-items: stretch;
    }

    .matching-select {
        width: 100%;
    }
}

/* Question Generator Floating Button */
.question-gen-floating-btn {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pulseGlow 2s ease-in-out infinite;
}

.question-gen-floating-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 32px rgba(245, 158, 11, 0.5);
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.question-gen-floating-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.question-gen-icon {
    font-size: 1.4em;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.question-gen-label {
    white-space: nowrap;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
    }
    50% {
        box-shadow: 0 8px 24px rgba(245, 158, 11, 0.6), 0 0 20px rgba(245, 158, 11, 0.3);
    }
}

/* Question Generator Modal */
.question-gen-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.question-gen-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.question-gen-modal-content {
    position: relative;
    width: 95%;
    max-width: 1000px;
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.question-gen-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.question-gen-modal-header h2 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.question-gen-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.question-gen-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.question-gen-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

/* Mobile adjustments for floating button */
@media (max-width: 768px) {
    .question-gen-floating-btn {
        top: auto;
        bottom: 20px;
        right: 20px;
        padding: 12px 18px;
        font-size: 0.9em;
    }

    .question-gen-label {
        display: none;
    }

    .question-gen-icon {
        font-size: 1.6em;
    }

    .question-gen-modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        max-width: 100%;
    }

    .question-gen-modal-header {
        padding: 15px 20px;
    }

    .question-gen-modal-header h2 {
        font-size: 1.4em;
    }
}

/* Chat Widget Styles */
.chat-widget {
    background: #1a1d2e;
    border-radius: 12px;
    padding: 20px;
    color: #e0e4f0;
    max-width: 100%;
    height: 600px;
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #2a2d3e;
}

.chat-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: #e0e4f0;
}

.chat-header-actions {
    display: flex;
    gap: 10px;
}

.chat-btn-icon {
    background: #2a2d3e;
    border: none;
    color: #e0e4f0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-btn-icon:hover {
    background: #3a3d4e;
    transform: scale(1.1);
}

.chat-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.chat-tab {
    flex: 1;
    padding: 10px 15px;
    background: #2a2d3e;
    border: none;
    color: #9aa5d0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.2s;
}

.chat-tab.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.chat-tab:hover:not(.active) {
    background: #3a3d4e;
}

.chat-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.chat-tab-content.active {
    display: block;
}

.chat-conversations-list,
.chat-users-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-conversation-item,
.chat-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #2a2d3e;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-conversation-item:hover,
.chat-user-item:hover {
    background: #3a3d4e;
    transform: translateX(4px);
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chat-avatar.online::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid #1a1d2e;
    border-radius: 50%;
}

.chat-conversation-item-info,
.chat-user-item-info {
    flex: 1;
    min-width: 0;
}

.chat-conversation-item-name,
.chat-user-item-name {
    font-weight: 600;
    color: #e0e4f0;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-conversation-item-preview {
    font-size: 0.85em;
    color: #9aa5d0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-conversation-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.chat-conversation-item-time {
    font-size: 0.75em;
    color: #6b7280;
}

.chat-unread-badge {
    background: #ef4444;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75em;
    font-weight: bold;
}

.chat-online-badge {
    font-size: 0.75em;
    color: #10b981;
    margin-left: 8px;
}

.chat-user-item-details {
    font-size: 0.8em;
    color: #6b7280;
}

.chat-message-user-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s;
}

.chat-message-user-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.chat-conversation-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-conversation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #2a2d3e;
    border-radius: 10px;
    margin-bottom: 15px;
}

.chat-back-btn {
    background: #3a3d4e;
    border: none;
    color: #e0e4f0;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s;
}

.chat-back-btn:hover {
    background: #4a4d5e;
}

.chat-conversation-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-conversation-name {
    font-weight: 600;
    color: #e0e4f0;
}

.chat-conversation-status {
    font-size: 0.85em;
    color: #6b7280;
}

.chat-conversation-status.online {
    color: #10b981;
}

.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #1a1d2e;
    border-radius: 10px;
    margin-bottom: 15px;
}

.chat-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 75%;
    word-wrap: break-word;
    margin-bottom: 16px;
}

.chat-message-sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message-received {
    align-self: flex-start;
}

/* Polished, shiny avatar for messages */
.chat-message-avatar {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
    position: relative;
    
    /* Polished/shiny effect */
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        0 0 0 2px rgba(255, 255, 255, 0.1),
        inset 0 2px 8px rgba(255, 255, 255, 0.2),
        inset 0 -2px 8px rgba(0, 0, 0, 0.2);
    
    /* Shiny gradient overlay */
    background-image: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(0, 0, 0, 0.2) 0%, transparent 50%);
    
    /* Smooth transitions */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* 3D effect */
    transform: perspective(1000px) rotateY(0deg);
}

.chat-message-avatar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.4) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.1) 100%
    );
    pointer-events: none;
}

.chat-message-avatar::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 20%;
    width: 30%;
    height: 30%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
    pointer-events: none;
    filter: blur(4px);
}

.chat-message-avatar:hover {
    transform: perspective(1000px) rotateY(5deg) scale(1.05);
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.4),
        0 0 0 3px rgba(255, 255, 255, 0.15),
        inset 0 2px 12px rgba(255, 255, 255, 0.3),
        inset 0 -2px 12px rgba(0, 0, 0, 0.3);
}

.chat-message-bubble {
    flex: 1;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

.chat-message-sent .chat-message-bubble {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message-received .chat-message-bubble {
    background: #2a2d3e;
    color: #e0e4f0;
    border-bottom-left-radius: 4px;
}

.chat-message-sender {
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 0.9;
}

.chat-message-content {
    margin-bottom: 6px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message-time {
    font-size: 0.7em;
    opacity: 0.7;
    margin-top: 4px;
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

#chatMessageInput {
    flex: 1;
    background: #2a2d3e;
    border: 2px solid #3a3d4e;
    color: #e0e4f0;
    padding: 12px;
    border-radius: 10px;
    font-size: 0.95em;
    font-family: inherit;
    resize: none;
}

#chatMessageInput:focus {
    outline: none;
    border-color: #6366f1;
}

.chat-send-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.chat-users-search {
    margin-bottom: 15px;
}

#chatUsersSearch {
    width: 100%;
    background: #2a2d3e;
    border: 2px solid #3a3d4e;
    color: #e0e4f0;
    padding: 12px;
    border-radius: 10px;
    font-size: 0.95em;
    font-family: inherit;
}

#chatUsersSearch:focus {
    outline: none;
    border-color: #6366f1;
}

.chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.chat-modal-content {
    position: relative;
    background: #1a1d2e;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 10001;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.chat-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #2a2d3e;
}

.chat-modal-header h3 {
    margin: 0;
    color: #e0e4f0;
}

.chat-modal-close {
    background: none;
    border: none;
    color: #9aa5d0;
    font-size: 2em;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.chat-modal-close:hover {
    background: #2a2d3e;
    color: #e0e4f0;
}

.chat-modal-body {
    padding: 20px;
}

.chat-profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chat-profile-disclaimer {
    background: linear-gradient(135deg, #2a2d3e 0%, #3a3d4e 100%);
    border-left: 4px solid #6366f1;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9em;
    color: #e0e4f0;
    line-height: 1.5;
}

.chat-profile-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-profile-field label {
    color: #e0e4f0;
    font-weight: 600;
    font-size: 0.95em;
}

.chat-profile-field input,
.chat-profile-field select {
    background: #2a2d3e;
    border: 2px solid #3a3d4e;
    color: #e0e4f0;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.95em;
    font-family: inherit;
}

.chat-profile-field input:focus,
.chat-profile-field select:focus {
    outline: none;
    border-color: #6366f1;
}

.chat-avatar-selector {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
}

.chat-avatar-option {
    aspect-ratio: 1;
    border: 3px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.chat-avatar-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.chat-avatar-option.selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.chat-save-profile-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    color: white;
    padding: 14px;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.chat-save-profile-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.chat-loading,
.chat-empty,
.chat-error {
    text-align: center;
    padding: 40px 20px;
    color: #9aa5d0;
}

.chat-error {
    color: #ef4444;
}

/* Chat Floating Button */
.chat-floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    color: white;
    font-size: 1.8em;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-floating-btn:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
}

.chat-floating-btn:active {
    transform: translateY(-2px) scale(1.05);
}

.chat-floating-btn.has-unread::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border: 2px solid white;
    border-radius: 50%;
}

/* Mobile Responsiveness for Chat */
@media (max-width: 768px) {
    .chat-widget {
        height: 500px;
        padding: 15px;
    }

    .chat-tabs {
        flex-direction: column;
        gap: 8px;
    }

    .chat-tab {
        width: 100%;
        flex: none;
        padding: 12px 15px;
        font-size: 0.9em;
    }

    .chat-avatar-selector {
        grid-template-columns: repeat(5, 1fr);
    }

    .chat-message {
        max-width: 85%;
    }

    .chat-floating-btn {
        display: none !important; /* Hide floating button on mobile */
    }
}

/* Forum Widget Styles */
.forum-widget {
    background: #1a1d2e;
    border-radius: 12px;
    padding: 20px;
    color: #e0e4f0;
    max-width: 100%;
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

.forum-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #2a2d3e;
    gap: 15px;
}

.forum-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: #e0e4f0;
    flex: 1;
}

.forum-back-to-rooms-btn {
    background: #2a2d3e;
    border: none;
    color: #e0e4f0;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
    white-space: nowrap;
}

.forum-back-to-rooms-btn:hover {
    background: #3a3d4e;
}

.forum-header-actions {
    display: flex;
    gap: 10px;
}

.forum-btn-icon {
    background: #2a2d3e;
    border: none;
    color: #e0e4f0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.forum-btn-icon:hover {
    background: #3a3d4e;
    transform: scale(1.1);
}

.forum-rooms-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.forum-room-item {
    background: #2a2d3e;
    border-radius: 10px;
    padding: 15px;
    transition: all 0.2s;
}

.forum-room-header {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.2s;
}

.forum-room-header:hover {
    background: #3a3d4e;
}

.forum-room-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.forum-room-info {
    flex: 1;
    min-width: 0;
}

.forum-room-name {
    font-weight: 600;
    color: #e0e4f0;
    font-size: 1.1em;
    margin-bottom: 4px;
}

.forum-room-description {
    font-size: 0.85em;
    color: #9aa5d0;
}

.forum-room-count {
    background: #3a3d4e;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    color: #e0e4f0;
    white-space: nowrap;
}

.forum-sub-rooms {
    margin-top: 15px;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.forum-sub-room-item {
    background: #1a1d2e;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.forum-sub-room-item:hover {
    background: #2a2d3e;
    border-left-color: #6366f1;
    transform: translateX(4px);
}

.forum-sub-room-name {
    font-weight: 600;
    color: #e0e4f0;
    margin-bottom: 4px;
}

.forum-sub-room-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.forum-sub-room-description {
    font-size: 0.8em;
    color: #9aa5d0;
    flex: 1;
}

.forum-sub-room-count {
    font-size: 0.75em;
    color: #6b7280;
    white-space: nowrap;
}

.forum-new-post {
    background: #2a2d3e;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.forum-new-post textarea {
    width: 100%;
    background: #1a1d2e;
    border: 1px solid #3a3d4e;
    border-radius: 8px;
    padding: 12px;
    color: #e0e4f0;
    font-family: inherit;
    font-size: 0.95em;
    resize: vertical;
    min-height: 80px;
}

.forum-new-post textarea:focus {
    outline: none;
    border-color: #6366f1;
}

.forum-post-btn {
    align-self: flex-end;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.forum-post-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.forum-posts-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

.forum-post {
    background: #2a2d3e;
    border-radius: 10px;
    padding: 15px;
    transition: all 0.2s;
}

.forum-post:hover {
    background: #3a3d4e;
}

.forum-post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.forum-post-author {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.forum-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.forum-author-info {
    flex: 1;
    min-width: 0;
}

.forum-author-name {
    font-weight: 600;
    color: #e0e4f0;
    margin-bottom: 2px;
}

.forum-post-time {
    font-size: 0.75em;
    color: #6b7280;
}

.forum-post-content {
    color: #e0e4f0;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.forum-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #2a2d3e;
    border-radius: 10px;
}

.forum-prev-btn,
.forum-next-btn {
    background: #3a3d4e;
    border: none;
    color: #e0e4f0;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.forum-prev-btn:hover:not(:disabled),
.forum-next-btn:hover:not(:disabled) {
    background: #4a4d5e;
}

.forum-prev-btn:disabled,
.forum-next-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.forum-page-info {
    color: #9aa5d0;
    font-size: 0.9em;
}

.forum-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.forum-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.forum-modal-content {
    position: relative;
    background: #2a2d3e;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 10001;
}

.forum-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #3a3d4e;
}

.forum-modal-header h3 {
    margin: 0;
    color: #e0e4f0;
}

.forum-modal-close {
    background: none;
    border: none;
    color: #e0e4f0;
    font-size: 1.5em;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.forum-modal-close:hover {
    background: #3a3d4e;
}

.forum-modal-body {
    padding: 20px;
}

.forum-profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.forum-profile-disclaimer {
    background: #1a1d2e;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #6366f1;
}

.forum-profile-disclaimer p {
    margin: 0;
    color: #9aa5d0;
    font-size: 0.9em;
    line-height: 1.5;
}

.forum-profile-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.forum-profile-field label {
    color: #e0e4f0;
    font-weight: 600;
    font-size: 0.95em;
}

.forum-avatar-selector {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    padding: 10px;
    background: #1a1d2e;
    border-radius: 8px;
}

.forum-avatar-option {
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.forum-avatar-option:hover {
    transform: scale(1.1);
    border-color: #6366f1;
}

.forum-avatar-option.selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

.forum-save-profile-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.2s;
    margin-top: 10px;
}

.forum-save-profile-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.forum-loading,
.forum-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9aa5d0;
}

.forum-empty {
    color: #6b7280;
}

/* Mobile Responsiveness for Forum */
@media (max-width: 768px) {
    .forum-widget {
        min-height: 500px;
        padding: 12px;
        border-radius: 8px;
    }

    .forum-header {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 15px;
        padding-bottom: 12px;
    }

    .forum-header h2 {
        font-size: 1.1em;
        flex: 1 1 100%;
        margin-bottom: 8px;
    }

    .forum-back-to-rooms-btn {
        font-size: 0.85em;
        padding: 10px 14px;
        min-height: 44px;
        flex: 1 1 auto;
    }

    .forum-header-actions {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .forum-btn-icon {
        width: 44px;
        height: 44px;
        font-size: 1.1em;
    }

    .forum-rooms-container {
        gap: 12px;
    }

    .forum-room-item {
        padding: 12px;
        border-radius: 8px;
    }

    .forum-room-header {
        flex-wrap: wrap;
        gap: 10px;
        padding: 8px;
    }

    .forum-room-icon {
        font-size: 1.4em;
        flex-shrink: 0;
    }

    .forum-room-info {
        flex: 1;
        min-width: 0;
    }

    .forum-room-name {
        font-size: 0.95em;
        line-height: 1.3;
        margin-bottom: 4px;
    }

    .forum-room-description {
        font-size: 0.8em;
        line-height: 1.4;
    }

    .forum-room-count {
        font-size: 0.75em;
        padding: 4px 8px;
        margin-top: 4px;
    }

    .forum-sub-rooms {
        padding-left: 8px;
        margin-top: 10px;
        gap: 8px;
    }

    .forum-sub-room-item {
        padding: 10px;
        border-radius: 6px;
    }

    .forum-sub-room-name {
        font-size: 0.9em;
        margin-bottom: 4px;
    }

    .forum-sub-room-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        font-size: 0.8em;
    }

    .forum-sub-room-description {
        font-size: 0.85em;
        line-height: 1.4;
    }

    .forum-sub-room-count {
        font-size: 0.75em;
        padding: 3px 6px;
    }

    .forum-new-post {
        padding: 12px;
        border-radius: 8px;
        margin-bottom: 15px;
    }

    .forum-new-post textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
        min-height: 120px;
        border-radius: 6px;
    }

    .forum-post-btn {
        padding: 12px 20px;
        font-size: 0.95em;
        min-height: 44px;
        width: 100%;
        margin-top: 10px;
    }

    .forum-posts-container {
        gap: 12px;
    }

    .forum-post {
        padding: 12px;
        border-radius: 8px;
    }

    .forum-post-header {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 10px;
    }

    .forum-post-author {
        flex: 1;
        min-width: 0;
    }

    .forum-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
        flex-shrink: 0;
    }

    .forum-author-info {
        min-width: 0;
    }

    .forum-author-name {
        font-size: 0.9em;
        margin-bottom: 2px;
    }

    .forum-post-time {
        font-size: 0.75em;
    }

    .forum-post-content {
        font-size: 0.9em;
        line-height: 1.6;
        padding: 10px 0;
    }

    .forum-pagination {
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }

    .forum-prev-btn,
    .forum-next-btn {
        width: 100%;
        padding: 12px;
        min-height: 44px;
        font-size: 0.95em;
    }

    .forum-page-info {
        text-align: center;
        font-size: 0.85em;
        padding: 8px;
    }

    .forum-modal-content {
        width: 95%;
        max-width: 95%;
        max-height: 90vh;
        margin: 5vh auto;
        padding: 20px;
    }

    .forum-modal-header {
        padding: 15px 0;
    }

    .forum-modal-header h3 {
        font-size: 1.1em;
    }

    .forum-modal-close {
        width: 36px;
        height: 36px;
        font-size: 1.2em;
    }

    .forum-profile-form {
        gap: 15px;
    }

    .forum-profile-field {
        margin-bottom: 15px;
    }

    .forum-profile-field label {
        font-size: 0.9em;
        margin-bottom: 6px;
    }

    .forum-profile-field input,
    .forum-profile-field textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
        min-height: 44px;
    }

    .forum-avatar-selector {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .forum-avatar-option {
        width: 100%;
        aspect-ratio: 1;
        font-size: 1.5em;
    }

    .forum-save-profile-btn {
        padding: 14px 24px;
        font-size: 1em;
        min-height: 44px;
        width: 100%;
    }

    .forum-loading,
    .forum-empty {
        padding: 30px 15px;
        font-size: 0.9em;
        text-align: center;
    }
}

/* Mental Dashboard Styles */
.mental-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mental-dashboard-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.mental-dashboard-header h2 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 10px;
}

.mental-dashboard-subtitle {
    color: #666;
    font-size: 1.1em;
}

.mental-dashboard-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.mental-tab {
    padding: 12px 20px;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    font-weight: 500;
}

.mental-tab:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.mental-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.mental-dashboard-content {
    min-height: 400px;
}

/* Overview Tab */
.mental-quote-card {
    background: linear-gradient(135deg, #f6f8ff 0%, #e8ecff 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
    border-left: 4px solid #667eea;
}

.quote-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
}

.quote-text {
    font-size: 1.3em;
    color: #333;
    font-style: italic;
    line-height: 1.6;
}

.mental-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.mental-stat-card {
    background: linear-gradient(135deg, #fff 0%, #f9f9f9 100%);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-top: 4px solid #667eea;
    transition: transform 0.3s;
}

.mental-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mental-quick-actions {
    margin-bottom: 30px;
}

.mental-quick-actions h3 {
    margin-bottom: 15px;
    color: #333;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.quick-action-btn {
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.mental-today-mood {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

.mental-today-mood h3 {
    margin-bottom: 15px;
    color: #333;
}

.mood-display {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mood-emoji {
    font-size: 3em;
}

.mood-level {
    font-size: 1.3em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.mood-note {
    color: #666;
    font-style: italic;
}

/* Streak Tab */
.mental-streak {
    text-align: center;
    padding: 40px 20px;
}

.streak-hero {
    margin-bottom: 30px;
}

.streak-fire {
    font-size: 5em;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.streak-number {
    font-size: 4em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.streak-label {
    font-size: 1.5em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.streak-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.streak-stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.streak-stat-label {
    color: #666;
    font-size: 0.9em;
}

.streak-stat-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #667eea;
}

.streak-message {
    font-size: 1.2em;
    color: #333;
    font-style: italic;
}

/* Mood Tab */
.mental-mood {
    max-width: 800px;
    margin: 0 auto;
}

.mood-input-section {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
}

.mood-input-section h3 {
    margin-bottom: 20px;
    color: #333;
}

.mood-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mood-btn {
    width: 60px;
    height: 60px;
    font-size: 2em;
    border: 3px solid #ddd;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.mood-btn:hover {
    transform: scale(1.1);
    border-color: #667eea;
}

.mood-btn.selected {
    border-color: #667eea;
    background: #f0f4ff;
    transform: scale(1.15);
}

.mood-note-input {
    width: 100%;
    max-width: 500px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 15px;
}

.save-mood-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.save-mood-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.mood-chart {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.mood-chart h3 {
    margin-bottom: 20px;
    color: #333;
}

.mood-chart-bars {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 200px;
    gap: 10px;
}

.mood-chart-bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.mood-chart-bar {
    width: 100%;
    background: linear-gradient(to top, #667eea, #764ba2);
    border-radius: 8px 8px 0 0;
    min-height: 10px;
    transition: all 0.3s;
}

.mood-chart-bar.mood-empty {
    background: #e0e0e0;
}

.mood-chart-label {
    font-size: 0.85em;
    color: #666;
    text-align: center;
}

.mood-history {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 12px;
}

.mood-history h3 {
    margin-bottom: 20px;
    color: #333;
}

.mood-history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mood-history-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mood-history-date {
    font-weight: bold;
    color: #667eea;
    min-width: 80px;
}

.mood-history-emoji {
    font-size: 2em;
}

.mood-history-label {
    flex: 1;
    color: #333;
}

.mood-history-note {
    color: #666;
    font-style: italic;
    font-size: 0.9em;
}

.no-data {
    text-align: center;
    color: #999;
    padding: 40px;
    font-style: italic;
}

/* Goals Tab */
.mental-goals {
    max-width: 800px;
    margin: 0 auto;
}

.goal-card {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 4px solid #667eea;
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.goal-header h3 {
    color: #333;
    margin: 0;
}

.edit-goal-btn {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
}

.edit-goal-btn:hover {
    background: #5568d3;
}

.goal-progress {
    margin-top: 15px;
}

.goal-progress-bar {
    width: 100%;
    height: 25px;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
}

.goal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
    border-radius: 12px;
}

.goal-stats {
    display: flex;
    justify-content: space-between;
    color: #666;
    font-size: 0.9em;
}

.goal-settings {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 12px;
    margin-top: 25px;
}

.goal-settings h3 {
    margin-bottom: 20px;
    color: #333;
}

.exam-countdown-setup {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.exam-countdown-setup input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
}

.save-exam-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s;
}

.save-exam-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.exam-countdown-display {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    margin-top: 20px;
}

.countdown-number {
    font-size: 4em;
    font-weight: bold;
    margin-bottom: 10px;
}

.countdown-label {
    font-size: 1.2em;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Breaks Tab */
.mental-breaks {
    max-width: 800px;
    margin: 0 auto;
}

.break-settings {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.break-settings h3 {
    margin-bottom: 20px;
    color: #333;
}

.break-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.break-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.break-interval {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.break-interval label {
    font-weight: 500;
}

.break-interval select {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
}

.save-break-settings-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s;
}

.save-break-settings-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.break-timer {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 30px;
}

.break-timer h3 {
    margin-bottom: 20px;
    color: #333;
}

.break-timer-display {
    font-size: 4em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 30px;
    font-family: 'Courier New', monospace;
}

.break-timer-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.break-timer-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.break-timer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.break-tips {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 12px;
}

.break-tips h3 {
    margin-bottom: 15px;
    color: #333;
}

.break-tips ul {
    list-style: none;
    padding: 0;
}

.break-tips li {
    padding: 10px 0;
    padding-left: 25px;
    position: relative;
    color: #666;
    line-height: 1.6;
}

.break-tips li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

/* Relax Tab */
.mental-relax {
    max-width: 800px;
    margin: 0 auto;
}

.breathing-exercise {
    background: #f9f9f9;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 30px;
}

.breathing-exercise h3 {
    margin-bottom: 15px;
    color: #333;
}

.breathing-exercise p {
    color: #666;
    margin-bottom: 30px;
}

.breathing-circle-container {
    position: relative;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

.breathing-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.1s ease;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.breathing-text {
    position: absolute;
    font-size: 1.3em;
    color: #667eea;
    font-weight: 500;
    margin-top: 180px;
}

.breathing-start-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.breathing-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.relaxation-quotes {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
}

.relaxation-quotes h3 {
    margin-bottom: 20px;
    color: #333;
}

.relax-quote {
    font-size: 1.3em;
    color: #333;
    font-style: italic;
    line-height: 1.8;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.new-quote-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s;
}

.new-quote-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mental-dashboard {
        padding: 15px;
    }

    .mental-dashboard-header h2 {
        font-size: 2em;
    }

    .mental-dashboard-tabs {
        flex-direction: column;
    }

    .mental-tab {
        width: 100%;
    }

    .mental-stats-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .mood-selector {
        gap: 10px;
    }

    .mood-btn {
        width: 50px;
        height: 50px;
        font-size: 1.5em;
    }

    .streak-number {
        font-size: 3em;
    }

    .countdown-number {
        font-size: 3em;
    }

    .break-timer-display {
        font-size: 3em;
    }

    .breathing-circle {
        width: 120px;
        height: 120px;
    }
}

/* EPC Network Graph Widget Styles */
.epc-network-graph-container {
    width: 100%;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.epc-network-graph-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 300px;
}

.epc-graph-search-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.epc-graph-search-input:focus {
    outline: none;
    border-color: #667eea;
}

.epc-graph-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
}

.epc-graph-btn:hover {
    background: #5568d3;
}

.filter-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-box label {
    font-weight: 600;
    color: #333;
}

.epc-graph-filter-select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    background: white;
}

.epc-network-graph-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.graph-stats {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.graph-legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.legend-color.article {
    background: #4A90E2;
}

.legend-color.rule {
    background: #50C878;
}

.legend-color.guideline {
    background: #FFA500;
}

.legend-color.decision {
    background: #9B59B6;
}

.epc-network-graph-svg-container {
    width: 100%;
    height: 600px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    overflow: hidden;
    position: relative;
}

.epc-network-graph-svg-container svg {
    width: 100%;
    height: 100%;
}

.epc-network-graph-details {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    max-height: 400px;
    overflow-y: auto;
}

.node-details h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 20px;
}

.node-description {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 4px;
}

.node-description h4 {
    margin: 0 0 10px 0;
    color: #667eea;
    font-size: 16px;
}

.node-description p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

.node-detail-section {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 4px;
}

.node-detail-section h4 {
    margin: 0 0 10px 0;
    color: #667eea;
    font-size: 16px;
}

.node-detail-section p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

.node-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.node-tag {
    display: inline-block;
    padding: 6px 12px;
    background: #e9ecef;
    color: #495057;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.node-tag.epc-hook {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 3px solid #17a2b8;
}

.node-tag.rule-tag {
    background: #d4edda;
    color: #155724;
    border-left: 3px solid #28a745;
}

.widget-link {
    color: #667eea;
    font-weight: 500;
}

.widget-link strong {
    color: #495057;
}

.node-connections h4 {
    margin: 20px 0 15px 0;
    color: #333;
    font-size: 18px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 8px;
}

.node-connections h5 {
    margin: 15px 0 10px 0;
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
}

.no-connections {
    color: #999;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.node-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.node-type-badge {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.node-type-badge.article {
    background: #4A90E2;
    color: white;
}

.node-type-badge.rule {
    background: #50C878;
    color: white;
}

.node-type-badge.guideline {
    background: #FFA500;
    color: white;
}

.node-type-badge.decision {
    background: #9B59B6;
    color: white;
}

.node-degree {
    padding: 6px 12px;
    background: #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

.node-connections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.connection-group h4 {
    margin: 0 0 10px 0;
    color: #667eea;
    font-size: 16px;
}

.connection-group ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.connection-group li {
    padding: 8px 12px;
    margin-bottom: 6px;
    background: white;
    border-radius: 4px;
    border-left: 3px solid #667eea;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.connection-type {
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 3px;
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
}

.epc-graph-tooltip {
    z-index: 1000;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .epc-network-graph-controls {
        flex-direction: column;
    }
    
    .search-box {
        width: 100%;
        min-width: auto;
    }
    
    .epc-network-graph-info {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .epc-network-graph-svg-container {
        height: 400px;
    }
    
    .node-connections {
        grid-template-columns: 1fr;
    }
}

/* EPC Deck Network Widget Styles */
.deck-network-widget {
    width: 100%;
    height: 800px;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    isolation: isolate; /* Create new stacking context */
    contain: layout style paint; /* Strict containment */
}

#widget-epc-deck-network {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    contain: layout style paint;
}

.deck-network-header {
    padding: 20px;
    background: white;
    border-bottom: 2px solid #e9ecef;
}

.deck-network-header h2 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.5em;
}

.deck-network-description {
    color: #6c757d;
    font-size: 0.9em;
    margin: 0 0 15px 0;
}

.deck-network-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.deck-network-btn {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.deck-network-btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

.deck-network-zoom-level {
    margin-left: auto;
    color: #6c757d;
    font-size: 0.9em;
}

.deck-network-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    isolation: isolate; /* Create new stacking context to contain deck view */
    z-index: 1;
    contain: layout style paint; /* Contain all rendering within this element */
}

.deck-network-svg-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

#deckNetworkSVG {
    width: 100%;
    height: 100%;
    background: #f8f9fa;
}

.deck-node {
    cursor: pointer;
    transition: all 0.2s;
}

.deck-node:hover circle {
    stroke-width: 3;
    filter: brightness(1.1);
}

.deck-node.selected circle:first-child {
    stroke: #667eea;
    stroke-width: 4;
    filter: brightness(1.2);
}

.deck-node[data-single-card="true"] circle:first-child {
    stroke-dasharray: 3,3;
    opacity: 0.85;
}

.deck-node[data-single-card="true"]:hover circle:first-child {
    opacity: 1;
    stroke-dasharray: none;
}

.deck-node circle:first-child {
    transition: all 0.3s ease;
}

.deck-node:hover circle:first-child {
    stroke-width: 4;
    filter: brightness(1.15);
    transform: scale(1.05);
}

.card-indicators rect {
    transition: opacity 0.2s;
}

.deck-node:hover .card-indicators rect {
    opacity: 1;
}

.deck-links line {
    stroke: #999;
    stroke-opacity: 0.3;
    stroke-width: 1.5;
}

.deck-links line:hover {
    stroke-opacity: 0.6;
    stroke-width: 2;
}

.deck-network-deck-view {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    padding: 20px;
    overflow-y: auto;
    z-index: 100; /* Ensure it's above other content */
    isolation: isolate; /* Create new stacking context */
    contain: layout style paint; /* Contain all rendering */
}

.deck-network-back-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    margin-bottom: 20px;
    transition: all 0.2s;
}

.deck-network-back-btn:hover {
    background: #5568d3;
}

.deck-network-deck-title {
    margin-bottom: 30px;
}

.deck-network-deck-title h3 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 1.8em;
}

.deck-network-deck-title p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9em;
}

.deck-network-cards-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: visible; /* Allow buttons to be fully visible */
    padding: 0;
    box-sizing: border-box;
    width: 100%;
}

.deck-network-cards-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 20px;
    padding-left: 60px; /* Space for left arrow */
    padding-right: 60px; /* Space for right arrow */
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #667eea #f0f0f0;
    touch-action: pan-x pan-y;
    flex: 1;
    /* Ensure at least 3 cards visible */
    min-width: calc(280px * 3 + 20px * 2);
}

/* Hide scrollbar when custom buttons are present */
.deck-network-cards-container.hide-scrollbar {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.deck-network-cards-container.hide-scrollbar::-webkit-scrollbar {
    display: none !important;
}

.deck-network-cards-container::-webkit-scrollbar {
    height: 8px;
}

.deck-network-cards-container::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.deck-network-cards-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.deck-network-cards-container::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

.deck-card-wrapper {
    width: 280px;
    height: 400px;
    perspective: 1000px;
    flex-shrink: 0;
    scroll-snap-align: start;
}

/* Show 3 cards at once when there are more than 3 cards */
.deck-network-cards-container.multiple-cards {
    width: calc(280px * 3 + 20px * 2); /* 3 cards + 2 gaps */
    margin: 0 auto;
}

.deck-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease-in-out;
    cursor: pointer;
    will-change: transform;
    user-select: none;
}

.deck-card.flipped {
    transform: rotateY(180deg) !important;
}

.deck-card-front,
.deck-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    background: white;
    border: 2px solid #e9ecef;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    gap: 0; /* Remove default gap between flex items */
}

.deck-card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    overflow-y: auto;
    overflow-x: hidden;
}

.deck-card-front::-webkit-scrollbar,
.deck-card-back::-webkit-scrollbar {
    width: 6px;
}

.deck-card-front::-webkit-scrollbar-track,
.deck-card-back::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
}

.deck-card-front::-webkit-scrollbar-thumb,
.deck-card-back::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.3);
    border-radius: 3px;
}

.deck-card-back::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
}

.deck-card-back::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.deck-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.deck-card-back .deck-card-header {
    border-bottom-color: rgba(255,255,255,0.3);
}

.deck-card-type {
    font-size: 1.5em;
}

.deck-card-id {
    font-size: 0.85em;
    color: #6c757d;
    font-weight: 600;
    font-family: monospace;
}

.deck-card-back .deck-card-id {
    color: rgba(255,255,255,0.9);
}

.deck-card-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 12px;
    line-height: 1.3;
}

.deck-card-back .deck-card-title {
    color: white;
}

.deck-card-summary {
    flex: 1;
    color: #495057;
    line-height: 1.6;
    font-size: 0.95em;
    min-height: 0;
    overflow-y: auto;
}

.deck-card-back .deck-card-summary {
    color: rgba(255,255,255,0.95);
}

.deck-card-explanation {
    flex: 1;
    color: rgba(255,255,255,0.95);
    line-height: 1.6;
    font-size: 0.95em;
    margin-bottom: 8px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px; /* Space for scrollbar */
}

.deck-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
    max-height: 60px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.deck-card-tags::-webkit-scrollbar {
    width: 4px;
}

.deck-card-tags::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

.deck-card-tag {
    padding: 3px 8px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-radius: 8px;
    font-size: 0.7em;
    font-weight: 600;
    line-height: 1.3;
}

.deck-card-back .deck-card-tag {
    background: rgba(255,255,255,0.2);
    color: white;
}

.deck-card-references {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.3);
    font-size: 0.8em;
    flex-shrink: 0;
}

.deck-card-references strong {
    display: inline-block;
    margin-right: 6px;
    margin-bottom: 4px;
    opacity: 0.9;
    font-size: 0.9em;
}

.deck-card-ref {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    margin: 2px 3px 2px 0;
    font-size: 0.85em;
    line-height: 1.4;
}

.deck-card-hint {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
    font-size: 0.75em;
    color: #6c757d;
    text-align: center;
    font-style: italic;
    flex-shrink: 0;
    order: 999;
}

.deck-card-back .deck-card-hint {
    border-top-color: rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.8);
}

.deck-network-scroll-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: none;
    font-size: 2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.deck-network-scroll-btn:hover {
    background: #5568d3;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.deck-network-scroll-btn:active {
    transform: scale(0.95);
}

.deck-network-scroll-left {
    position: absolute;
    left: 10px;
    z-index: 20;
    flex-shrink: 0;
}

.deck-network-scroll-right {
    position: absolute;
    right: 10px;
    z-index: 20;
    flex-shrink: 0;
}

.deck-tooltip-open-btn:hover {
    background: #5568d3 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.deck-tooltip-open-btn:active {
    transform: translateY(0);
}

/* Mobile Responsiveness for Deck Network */
@media (max-width: 768px) {
    .deck-network-widget {
        height: 600px;
    }
    
    .deck-network-cards-container {
        gap: 15px;
    }
    
    .deck-card-wrapper {
        width: 260px;
        height: 380px;
    }
    
    .deck-card-front,
    .deck-card-back {
        padding: 12px;
    }
    
    .deck-card-explanation {
        font-size: 0.9em;
        line-height: 1.5;
    }
    
    .deck-card-tags {
        max-height: 50px;
        gap: 3px;
    }
    
    .deck-card-tag {
        font-size: 0.65em;
        padding: 2px 6px;
    }
    
    .deck-card-references {
        font-size: 0.75em;
    }
    
    .deck-card-ref {
        font-size: 0.8em;
        padding: 2px 5px;
    }
}

/* ============================================================
   FINAL GRID FIX: UNIFIED TWO-COLUMN LAYOUT
   ============================================================ */

/* 1. Tüm ara grupları (kapsayıcıları) yok sayarak çocukları ana grid'e aktar.
   Bu sayede farklı div'lerde olsalar bile hepsi tek bir grid'de birleşir. */
.nav-accordion,
.nav-column,
.nav-column-stories,
.nav-accordion-widgets,
.nav-accordion-stories,
.nav-accordion-forum,
[class*="nav-accordion-"] {
    display: contents !important;
}

/* 2. Ana Kapsayıcıyı (Parent) 2 Sütunlu Grid yap */
.main-nav {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important; /* %50 - %50 kesin bölme */
    gap: 12px !important;
    grid-auto-flow: row dense !important;
    width: 100% !important;
    padding: 30px !important;
}

/* 3. Tüm ana başlıkları (accordion-item) yarım sütuna zorla */
.main-nav .accordion-item.main-accordion {
    grid-column: span 1 !important; 
    width: 100% !important;
    min-width: 0 !important; /* Uzun başlıkların kutuyu genişletmesini engeller */
    margin: 0 !important;
}

/* 4. SADECE Expanded (tıklanmış) başlık tam satırı kaplasın */
.main-nav .accordion-item.main-accordion.active {
    grid-column: 1 / -1 !important;
}

/* 5. "Pre-Scenario Fee Calculation" gibi uzun başlıkların taşmasını engelle */
.accordion-header {
    min-width: 0 !important;
    display: flex !important;
    overflow: hidden !important;
}

.accordion-title-group {
    min-width: 0 !important;
    flex: 1 !important;
}

.accordion-title {
    white-space: normal !important; /* Metnin alt satıra geçmesine izin verir */
    word-break: break-word !important;
    line-height: 1.2 !important;
    font-size: 1.05em !important;
}

/* 6. Mobil Düzen (Tek Sütun) */
@media (max-width: 768px) {
    .main-nav {
        grid-template-columns: 1fr !important;
    }
    .main-nav .accordion-item.main-accordion {
        grid-column: 1 / -1 !important;
    }
}
