/* Enhanced Typography Scale & Visual Hierarchy */
:root {
    /* Typography Scale */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.25rem;     /* 36px */
    --text-5xl: 3rem;        /* 48px */
    
    /* Spacing Scale */
    --space-1: 0.25rem;      /* 4px */
    --space-2: 0.5rem;       /* 8px */
    --space-3: 0.75rem;      /* 12px */
    --space-4: 1rem;         /* 16px */
    --space-5: 1.25rem;      /* 20px */
    --space-6: 1.5rem;       /* 24px */
    --space-8: 2rem;         /* 32px */
    --space-10: 2.5rem;      /* 40px */
    --space-12: 3rem;        /* 48px */
    --space-16: 4rem;        /* 64px */
    --space-20: 5rem;        /* 80px */
    
    /* Visual Hierarchy Colors */
    --color-primary: #3b82f6;
    --color-primary-light: rgba(59, 130, 246, 0.1);
    --color-text-primary: #ffffff;
    --color-text-secondary: #cbd5e1;
    --color-text-muted: #94a3b8;
    --color-text-subtle: #64748b;
}

/* Space Travel Calculator Specific Styles */
.space-hero {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    position: relative;
    overflow: hidden;
}

.space-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><circle cx="100" cy="100" r="1" fill="white" opacity="0.8"/><circle cx="300" cy="200" r="1.5" fill="white" opacity="0.6"/><circle cx="500" cy="150" r="1" fill="white" opacity="0.9"/><circle cx="700" cy="300" r="1.2" fill="white" opacity="0.7"/><circle cx="200" cy="400" r="1" fill="white" opacity="0.8"/><circle cx="800" cy="100" r="1.5" fill="white" opacity="0.5"/><circle cx="600" cy="500" r="1" fill="white" opacity="0.9"/><circle cx="400" cy="600" r="1.3" fill="white" opacity="0.6"/><circle cx="900" cy="400" r="1" fill="white" opacity="0.8"/><circle cx="150" cy="700" r="1.2" fill="white" opacity="0.7"/></svg>') repeat;
    animation: stars 20s linear infinite;
}

@keyframes stars {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100px); }
}

.space-container {
    position: relative;
    z-index: 2;
}

.mission-control {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid #334155;
    border-radius: 16px;
    padding: var(--space-8);
    margin: var(--space-8) 0;
    backdrop-filter: blur(10px);
}

/* Enhanced Section Headers */
.section-title-space {
    color: var(--color-primary);
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    position: relative;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.section-title-space::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), transparent);
    margin-left: var(--space-4);
}

/* Hero Title Enhancement for WCAG Compliance */
.hero-title {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 20px rgba(59, 130, 246, 0.3) !important;
    font-size: var(--text-5xl) !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    margin-bottom: var(--space-6) !important;
}

/* Hero Subtitle Enhancement */
.hero-subtitle {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7) !important;
    font-size: var(--text-lg) !important;
    line-height: 1.6 !important;
    margin-bottom: 2rem !important;
}

.section-subtitle {
    color: var(--color-text-muted);
    font-size: var(--text-lg);
    margin-bottom: var(--space-8);
    font-weight: 400;
    line-height: 1.6;
}

.section-description {
    color: var(--color-text-secondary);
    font-size: var(--text-base);
    line-height: 1.7;
    margin-bottom: var(--space-6);
}

.destination-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
    margin: var(--space-6) 0;
}

.destination-card {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border: 1px solid #475569;
    border-radius: 12px;
    padding: var(--space-6);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.destination-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.25);
}

.destination-card.selected {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, #1e40af 0%, var(--color-primary) 100%);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.destination-card.calculating {
    animation: calculating 1s ease-in-out;
}

@keyframes calculating {
    0%, 100% { box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3); }
    50% { box-shadow: 0 12px 32px rgba(59, 130, 246, 0.6); }
}

.destination-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.destination-icon {
    font-size: var(--text-4xl);
    line-height: 1;
}

.destination-name {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.3;
}

.destination-distance {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    font-weight: 500;
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.destination-info {
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    line-height: 1.5;
    opacity: 0.9;
}

.propulsion-selector {
    background: rgba(30, 41, 59, 0.8);
    border-radius: 12px;
    padding: var(--space-8);
    margin: var(--space-8) 0;
    border: 1px solid #475569;
}

.propulsion-title {
    color: var(--color-primary);
    font-size: var(--text-2xl);
    font-weight: 600;
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.propulsion-description {
    color: var(--color-text-muted);
    font-size: var(--text-base);
    margin-bottom: var(--space-6);
    line-height: 1.6;
}

.propulsion-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.propulsion-option {
    background: #334155;
    border: 2px solid #475569;
    border-radius: 8px;
    padding: var(--space-5);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
}

.propulsion-option:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
}

.propulsion-option.selected {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
}

.propulsion-option.calculating {
    animation: calculating 1s ease-in-out;
}

.propulsion-name {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.propulsion-speed {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    font-weight: 500;
}

.results-panel {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid var(--color-primary);
    border-radius: 16px;
    padding: var(--space-8);
    margin: var(--space-8) 0;
    position: relative;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.results-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.results-panel.updating {
    opacity: 0.7;
    transform: scale(0.98);
}

.results-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    animation: scan 2s ease-in-out infinite;
}

@keyframes scan {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.results-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-8);
}

.results-title {
    color: var(--color-primary);
    font-size: var(--text-3xl);
    font-weight: 700;
}

.results-subtitle {
    color: var(--color-text-muted);
    font-size: var(--text-lg);
    margin-bottom: var(--space-6);
    line-height: 1.6;
}

.journey-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-6);
    margin: var(--space-6) 0;
}

.stat-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #475569;
    border-radius: 12px;
    padding: var(--space-6);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), #06b6d4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-value {
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-2);
    line-height: 1.1;
    transition: all 0.4s ease;
    position: relative;
}

.stat-value.updating {
    opacity: 0.5;
    transform: scale(0.95);
}

.stat-value.updated {
    animation: valueUpdate 0.6s ease;
}

@keyframes valueUpdate {
    0% { transform: scale(0.95); opacity: 0.5; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.stat-label {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-description {
    color: var(--color-text-subtle);
    font-size: var(--text-xs);
    margin-top: var(--space-1);
    line-height: 1.4;
}

.transfer-windows {
    background: rgba(15, 23, 42, 0.8);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.window-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.window-table th,
.window-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #334155;
}

.window-table th {
    color: #3b82f6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.window-table td {
    color: #cbd5e1;
}

.btn-space {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-space:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.section-title-space {
    color: #3b82f6;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb {
    color: #cbd5e1;
    margin-bottom: 2rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.breadcrumb a {
    color: #60a5fa;
    text-decoration: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.breadcrumb a:hover {
    text-decoration: underline;
    color: #93c5fd;
}

.hero-subtitle {
    color: #ffffff;
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Progressive Disclosure Styles */
.destination-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
}

.destination-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text-subtle);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: var(--space-2) var(--space-4);
    border-radius: 6px;
    border: 1px solid transparent;
}

.destination-toggle:hover {
    color: var(--color-primary);
    background: var(--color-primary-light);
    border-color: var(--color-primary);
}

.destination-toggle.active {
    color: var(--color-primary);
    background: var(--color-primary-light);
}

.toggle-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: var(--text-base);
}

.destination-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.destination-mode-toggle {
    display: flex;
    gap: var(--space-2);
}

.mode-btn {
    background: rgba(51, 65, 85, 0.8);
    border: 1px solid #475569;
    color: var(--color-text-subtle);
    padding: var(--space-2) var(--space-4);
    border-radius: 6px;
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.mode-btn.active {
    color: var(--color-primary);
    background: var(--color-primary-light);
    border-color: var(--color-primary);
}

/* Contextual Help & Tooltips */
.help-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    color: var(--color-text-subtle);
    margin-left: var(--space-2);
}

.help-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: var(--color-text-primary);
    padding: var(--space-3) var(--space-4);
    border-radius: 8px;
    font-size: var(--text-sm);
    white-space: nowrap;
    z-index: 1000;
    border: 1px solid var(--color-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.help-tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--color-primary);
    z-index: 1001;
}

.section-hint {
    color: var(--color-text-subtle);
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
    font-style: italic;
}

.contextual-help {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: var(--space-4);
    margin: var(--space-4) 0;
    color: var(--color-text-subtle);
    font-size: var(--text-sm);
    line-height: 1.5;
}

.contextual-help .help-icon {
    color: var(--color-primary);
    margin-right: var(--space-2);
}

.destination-section.hidden {
    display: none;
}

.quick-start-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
    max-width: 1000px;
}

.section-hint {
    color: var(--color-text-muted);
    font-size: var(--text-base);
    margin-bottom: var(--space-6);
    font-style: italic;
    line-height: 1.6;
}

.destination-card.selected {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
}

.destination-card.selected::before {
    content: '✓';
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    color: var(--color-primary);
    font-weight: bold;
    font-size: var(--text-xl);
    background: rgba(255, 255, 255, 0.1);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Premium Share Component Styles */
.share-component {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none; /* Initially hidden */
    align-items: center;
    justify-content: center;
    animation: shareOverlayFadeIn 0.3s ease-out;
}

.share-container {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    padding: var(--space-8);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: shareModalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.share-header {
    text-align: center;
    margin-bottom: var(--space-6);
}

.share-icon {
    font-size: 3rem;
    margin-bottom: var(--space-3);
    animation: shareIconPulse 2s infinite;
}

.share-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-2);
}

.share-subtitle {
    color: var(--color-text-subtle);
    font-size: var(--text-base);
}

.share-preview {
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    text-align: center;
}

.preview-label {
    color: var(--color-primary);
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: var(--space-4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-content {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.preview-placeholder {
    color: var(--color-text-subtle);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

.preview-icon {
    font-size: 3rem;
    opacity: 0.5;
}

#shareCanvas {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.share-actions {
    text-align: center;
}

.share-btn {
    background: linear-gradient(135deg, var(--color-primary) 0%, #1d4ed8 100%);
    border: none;
    color: white;
    padding: var(--space-4) var(--space-6);
    border-radius: 12px;
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.share-btn:active {
    transform: translateY(0);
}

.share-options {
    margin-top: var(--space-6);
    animation: shareOptionsSlideIn 0.3s ease-out;
}

.share-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-4);
}

.share-option {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: var(--space-4);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
}

.share-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.share-option-icon {
    font-size: 1.5rem;
}

.share-option-text {
    font-size: var(--text-sm);
    font-weight: 500;
}

.share-option.twitter:hover {
    border-color: #1da1f2;
    box-shadow: 0 8px 20px rgba(29, 161, 242, 0.3);
}

.share-option.facebook:hover {
    border-color: #4267b2;
    box-shadow: 0 8px 20px rgba(66, 103, 178, 0.3);
}

.share-option.linkedin:hover {
    border-color: #0077b5;
    box-shadow: 0 8px 20px rgba(0, 119, 181, 0.3);
}

.share-option.reddit:hover {
    border-color: #ff4500;
    box-shadow: 0 8px 20px rgba(255, 69, 0, 0.3);
}

.share-option.email:hover {
    border-color: #34d399;
    box-shadow: 0 8px 20px rgba(52, 211, 153, 0.3);
}

.share-option.download:hover {
    border-color: #f59e0b;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

.share-footer {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
}

.close-share {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--color-text-subtle);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    transition: all 0.3s ease;
}

.close-share:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: rotate(90deg);
}

.results-actions {
    text-align: center;
    margin: var(--space-6) 0;
}

.share-results-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: white;
    padding: var(--space-3) var(--space-6);
    border-radius: 12px;
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.share-results-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* Share Component Animations */
@keyframes shareOverlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes shareModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes shareIconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

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

/* Responsive Design for Share Component */
@media (max-width: 768px) {
    .share-container {
        padding: var(--space-6);
        margin: var(--space-4);
        width: calc(100% - 2rem);
    }
    
    .share-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .share-title {
        font-size: var(--text-xl);
    }
}