/* 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;
}

/* 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;
    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.05)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.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;
}

.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;
    gap: 50px;
    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: 8px;
}

.stat-number {
    font-size: 2.4em;
    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.85em;
    color: rgba(255, 255, 255, 0.95);
    text-transform: uppercase;
    letter-spacing: 1px;
    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;
}

.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;
}

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

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

.nav-link:hover {
    background: linear-gradient(90deg, #e3f2fd 0%, #ffffff 100%);
    color: #1976d2;
    transform: translateX(8px);
    border-left-color: #3498db;
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.15);
}

.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;
}

.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 */
.nav-accordion {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 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) */
.nav-accordion-widgets,
.nav-accordion-stories {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.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);
}

.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);
}

.accordion-header {
    width: 100%;
    padding: 18px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: none;
    cursor: pointer;
    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;
}

.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;
}

.accordion-title {
    flex: 1;
    font-weight: 600;
}

.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;
}

.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;
}

.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;
    background: white;
    padding: 0 20px;
}

.accordion-content[style*="max-height"]:not([style*="max-height: 0"]) {
    padding: 20px;
    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;
}

/* 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: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
        padding: 10px 15px !important;
        font-size: 0.85em !important;
    }
    
    .user-info-left {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
        width: 100% !important;
    }
    
            .user-info-left > span:first-child {
                font-size: 1em !important;
                margin-right: 0 !important;
                white-space: nowrap !important;
        margin-bottom: 5px !important;
    }
    
    .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.8em !important;
        padding: 3px 10px !important;
    }
    
    .logout-btn {
        width: 100% !important;
        text-align: center !important;
        padding: 8px 16px !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 wrapping on mobile - reduced font size to fit */
    .site-title,
    header p.site-title,
    p.site-title {
        font-size: 1em !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
        display: inline-block;
        max-width: 100%;
        word-break: keep-all !important;
        word-wrap: normal !important;
        hyphens: none !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: 15px;
        margin-top: 20px;
        padding-top: 20px;
        flex-wrap: wrap;
    }
    
    .stat-number {
        font-size: 1.5em;
    }
    
    .stat-label {
        font-size: 0.7em;
    }
    
    /* 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: 15px;
        margin-top: 10px;
    }
    
    .nav-item-expandable {
        margin-bottom: 10px;
    }
    
    /* Accordion Mobile */
    .nav-accordion {
        gap: 10px;
    }
    
    .accordion-item {
        border-radius: 8px;
    }
    
    .accordion-header {
        padding: 14px 16px;
        font-size: 1em;
        gap: 8px;
    }
    
    .accordion-icon {
        font-size: 1.2em;
    }
    
    .accordion-title {
        font-size: 0.95em;
    }
    
    .accordion-count {
        font-size: 0.75em;
        padding: 3px 10px;
        min-width: 28px;
    }
    
    .accordion-arrow {
        font-size: 0.8em;
    }
    
    .accordion-content[style*="max-height"]:not([style*="max-height: 0"]) {
        padding: 15px;
    }
    
    .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: 0.9em !important;
        overflow: visible !important;
        text-overflow: clip !important;
        white-space: nowrap !important;
        word-break: keep-all !important;
        word-wrap: normal !important;
        hyphens: none !important;
    }
    
    .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;
}

/* 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: fadeIn 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;
}
