/**
 * Hijri Birthday Calculator - Sacred Geometric Night Sky Theme
 * Celestial dark design with gold accents
 */

/* ========================================
   CSS VARIABLES
   ======================================== */

:root {
    /* Celestial Color Palette */
    --hbc-midnight: #0A1628;
    --hbc-deep-space: #0F1D32;
    --hbc-night-blue: #152238;
    --hbc-twilight: #1E3050;

    /* Islamic Emerald Tones */
    --hbc-emerald-deep: #0D3B2D;
    --hbc-emerald: #10503D;

    /* Sacred Gold Palette */
    --hbc-gold: #D4A941;
    --hbc-gold-light: #E8D5A3;
    --hbc-brass: #C4A35A;

    /* Semantic Colors */
    --hbc-success: #10B981;
    --hbc-warning: #F59E0B;
    --hbc-error: #EF4444;

    /* Neutral Tones */
    --hbc-cream: #F5F5F0;
    --hbc-pearl: #E8E8E3;
    --hbc-mist: #94A3B8;
    --hbc-slate: #64748B;

    /* Typography */
    --hbc-font-display: 'Cormorant Garamond', Georgia, serif;
    --hbc-font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --hbc-font-arabic: 'Noto Naskh Arabic', serif;

    /* Spacing */
    --hbc-spacing-xs: 0.5rem;
    --hbc-spacing-sm: 1rem;
    --hbc-spacing-md: 1.5rem;
    --hbc-spacing-lg: 2rem;
    --hbc-spacing-xl: 3rem;

    /* Border Radius */
    --hbc-radius-sm: 4px;
    --hbc-radius-md: 8px;
    --hbc-radius-lg: 16px;
    --hbc-radius-full: 9999px;

    /* Shadows */
    --hbc-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --hbc-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --hbc-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --hbc-shadow-glow: 0 0 40px rgba(212, 169, 65, 0.2);

    /* Transitions */
    --hbc-transition: all 0.3s ease;
}

/* ========================================
   BASE STYLES
   ======================================== */

.hijri-birthday-calculator-page {
    font-family: var(--hbc-font-body);
    color: var(--hbc-cream);
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--hbc-spacing-md);
}

/* Arabic/Urdu RTL Support */
.hijri-birthday-calculator-page[lang="ar"],
.hijri-birthday-calculator-page[lang="ur"] {
    font-family: var(--hbc-font-arabic), var(--hbc-font-body);
    direction: rtl;
}

/* ========================================
   LANGUAGE SWITCHER
   ======================================== */

.language-switcher {
    display: flex;
    gap: var(--hbc-spacing-xs);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--hbc-spacing-lg);
    padding: var(--hbc-spacing-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--hbc-radius-lg);
}

.lang-btn {
    padding: var(--hbc-spacing-xs) var(--hbc-spacing-sm);
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--hbc-pearl);
    border-radius: var(--hbc-radius-full);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--hbc-transition);
}

.lang-btn:hover {
    border-color: var(--hbc-gold);
    background: rgba(212, 169, 65, 0.1);
    color: var(--hbc-gold);
}

.lang-btn.active {
    border-color: var(--hbc-gold);
    background: var(--hbc-gold);
    color: var(--hbc-midnight);
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero-section {
    text-align: center;
    margin-bottom: var(--hbc-spacing-xl);
    padding: var(--hbc-spacing-xl) var(--hbc-spacing-md);
    background: linear-gradient(135deg, var(--hbc-emerald-deep), var(--hbc-emerald));
    color: var(--hbc-cream);
    border-radius: var(--hbc-radius-lg);
    border: 1px solid rgba(212, 169, 65, 0.2);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255,255,255,0.2), transparent);
    background-size: 200px 200px;
    animation: twinkle 4s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.hero-title {
    font-family: var(--hbc-font-display);
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 var(--hbc-spacing-sm) 0;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

.hero-description {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.95;
    color: var(--hbc-pearl);
    position: relative;
    z-index: 1;
}

/* ========================================
   FEATURE HIGHLIGHTS
   ======================================== */

.feature-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--hbc-spacing-md);
    margin-bottom: var(--hbc-spacing-xl);
}

.feature-card {
    background: linear-gradient(145deg, rgba(30, 48, 80, 0.4), rgba(15, 29, 50, 0.6));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--hbc-radius-lg);
    padding: var(--hbc-spacing-md);
    text-align: center;
    transition: var(--hbc-transition);
}

.feature-card:hover {
    border-color: rgba(212, 169, 65, 0.3);
    box-shadow: var(--hbc-shadow-md);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: var(--hbc-spacing-sm);
}

.feature-card h3 {
    color: var(--hbc-gold);
    margin: var(--hbc-spacing-sm) 0;
    font-size: 1.2rem;
}

.feature-card p {
    color: var(--hbc-mist);
    font-size: 0.95rem;
    margin: 0;
}

/* ========================================
   HOW IT WORKS
   ======================================== */

.how-it-works {
    margin-bottom: var(--hbc-spacing-xl);
    padding: var(--hbc-spacing-lg);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--hbc-radius-lg);
}

.how-it-works h2 {
    text-align: center;
    color: var(--hbc-cream);
    font-family: var(--hbc-font-display);
    margin-bottom: var(--hbc-spacing-lg);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--hbc-spacing-md);
}

.step {
    text-align: center;
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--hbc-gold), var(--hbc-brass));
    color: var(--hbc-midnight);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto var(--hbc-spacing-sm);
}

.step h3 {
    color: var(--hbc-cream);
    margin: var(--hbc-spacing-sm) 0;
}

.step p {
    color: var(--hbc-mist);
    font-size: 0.95rem;
}

/* ========================================
   MAIN CALCULATOR APP LAYOUT
   ======================================== */

.hijri-birthday-calculator-app {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--hbc-spacing-lg);
    margin-bottom: var(--hbc-spacing-xl);
}

@media (max-width: 992px) {
    .hijri-birthday-calculator-app {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   INPUT COLUMN
   ======================================== */

.calculator-input-column {
    background: linear-gradient(145deg, rgba(30, 48, 80, 0.4), rgba(15, 29, 50, 0.6));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--hbc-radius-lg);
    padding: var(--hbc-spacing-lg);
}

.section-title {
    color: var(--hbc-gold);
    margin: 0 0 var(--hbc-spacing-sm) 0;
    font-size: 1.5rem;
}

.section-description {
    color: var(--hbc-mist);
    margin: 0 0 var(--hbc-spacing-lg) 0;
}

/* Date Input Form */
.date-input-form {
    display: grid;
    grid-template-columns: 1fr 2fr 1.5fr;
    gap: var(--hbc-spacing-sm);
    margin-bottom: var(--hbc-spacing-md);
}

@media (max-width: 768px) {
    .date-input-form {
        grid-template-columns: 1fr;
    }
}

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

.form-group label {
    font-weight: 600;
    margin-bottom: var(--hbc-spacing-xs);
    color: var(--hbc-pearl);
    font-size: 0.9rem;
}

.form-control {
    padding: var(--hbc-spacing-sm);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--hbc-radius-md);
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.2);
    color: var(--hbc-cream);
    transition: var(--hbc-transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--hbc-gold);
    box-shadow: 0 0 0 3px rgba(212, 169, 65, 0.2);
}

/* Quick Presets */
.quick-presets {
    margin-top: var(--hbc-spacing-md);
    text-align: center;
}

.presets-label {
    font-size: 0.9rem;
    color: var(--hbc-mist);
    margin-bottom: var(--hbc-spacing-xs);
}

.preset-btn {
    padding: var(--hbc-spacing-xs) var(--hbc-spacing-sm);
    background: rgba(212, 169, 65, 0.15);
    border: 1px solid rgba(212, 169, 65, 0.3);
    border-radius: var(--hbc-radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--hbc-transition);
    color: var(--hbc-gold-light);
}

.preset-btn:hover {
    background: var(--hbc-gold);
    color: var(--hbc-midnight);
    border-color: var(--hbc-gold);
}

/* ========================================
   APP STATES
   ======================================== */

.app-state {
    display: none;
}

.app-state.active {
    display: block;
}

/* Loading State */
#loading-state {
    text-align: center;
    padding: var(--hbc-spacing-xl);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--hbc-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--hbc-spacing-md);
}

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

.loading-text {
    color: var(--hbc-mist);
    font-size: 1.1rem;
}

/* Error State */
#error-state {
    text-align: center;
    padding: var(--hbc-spacing-xl);
}

.error-icon {
    font-size: 4rem;
    margin-bottom: var(--hbc-spacing-sm);
}

.error-title {
    color: #FCA5A5;
    margin: var(--hbc-spacing-sm) 0;
}

.error-message {
    color: var(--hbc-mist);
    margin-bottom: var(--hbc-spacing-md);
}

/* ========================================
   RESULTS COLUMN
   ======================================== */

.calculator-results-column {
    display: flex;
    flex-direction: column;
    gap: var(--hbc-spacing-md);
}

.results-panel {
    display: flex;
    flex-direction: column;
    gap: var(--hbc-spacing-md);
}

/* Result Cards */
.result-card {
    background: linear-gradient(145deg, rgba(30, 48, 80, 0.4), rgba(15, 29, 50, 0.6));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--hbc-radius-lg);
    padding: var(--hbc-spacing-md);
    transition: var(--hbc-transition);
}

.result-card:hover {
    box-shadow: var(--hbc-shadow-md);
}

.card-title {
    color: var(--hbc-gold);
    margin: 0 0 var(--hbc-spacing-sm) 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.card-content {
    color: var(--hbc-pearl);
}

/* Primary Card (Hijri Birthday) */
.primary-card {
    background: linear-gradient(135deg, var(--hbc-emerald-deep), var(--hbc-emerald));
    border: 1px solid rgba(212, 169, 65, 0.2);
    box-shadow: var(--hbc-shadow-glow);
}

.primary-card .card-title {
    color: var(--hbc-cream);
}

.hijri-date-large {
    font-family: var(--hbc-font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--hbc-spacing-xs);
    color: var(--hbc-gold);
    text-shadow: 0 0 20px rgba(212, 169, 65, 0.3);
}

.hijri-date-arabic {
    font-family: var(--hbc-font-arabic);
    font-size: 1.3rem;
    opacity: 0.9;
    color: var(--hbc-pearl);
}

/* Highlight Card (Islamic Age) */
.highlight-card {
    border: 2px solid rgba(212, 169, 65, 0.3);
    background: linear-gradient(145deg, rgba(212, 169, 65, 0.1), rgba(15, 29, 50, 0.6));
}

.age-display {
    font-family: var(--hbc-font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--hbc-gold);
    margin-bottom: var(--hbc-spacing-xs);
}

.age-breakdown {
    font-size: 0.95rem;
    color: var(--hbc-mist);
}

/* Next Birthday Card */
.next-birthday {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--hbc-cream);
    margin-bottom: var(--hbc-spacing-sm);
}

.countdown-container {
    padding: var(--hbc-spacing-sm);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--hbc-radius-md);
    text-align: center;
    font-size: 1.1rem;
}

.countdown-container strong {
    color: var(--hbc-gold);
    font-family: var(--hbc-font-display);
    font-size: 2rem;
    font-weight: 700;
    display: block;
    margin: var(--hbc-spacing-xs) 0;
}

/* Statistics Card */
.statistics-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.statistics-list li {
    padding: var(--hbc-spacing-sm) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--hbc-pearl);
}

.statistics-list li:last-child {
    border-bottom: none;
}

.statistics-list li::before {
    content: "✨ ";
    margin-right: var(--hbc-spacing-xs);
}

/* Moon Phase Card */
.moon-phase-container {
    text-align: center;
}

.moon-icon {
    font-size: 4rem;
    margin-bottom: var(--hbc-spacing-sm);
}

.moon-phase-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--hbc-gold);
}

/* Historical Events Card */
.events-list {
    display: flex;
    flex-direction: column;
    gap: var(--hbc-spacing-sm);
}

.event-item {
    padding: var(--hbc-spacing-sm);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--hbc-radius-md);
    border-left: 3px solid var(--hbc-gold);
}

.event-year {
    font-weight: 700;
    color: var(--hbc-gold);
    font-size: 0.9rem;
}

.event-title {
    font-weight: 600;
    color: var(--hbc-cream);
    margin: var(--hbc-spacing-xs) 0;
}

.event-description {
    font-size: 0.9rem;
    color: var(--hbc-mist);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    padding: var(--hbc-spacing-sm) var(--hbc-spacing-md);
    border: none;
    border-radius: var(--hbc-radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--hbc-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--hbc-spacing-xs);
    text-decoration: none;
}

.btn-large {
    padding: var(--hbc-spacing-md) var(--hbc-spacing-lg);
    font-size: 1.1rem;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--hbc-gold), var(--hbc-brass));
    color: var(--hbc-midnight);
    box-shadow: var(--hbc-shadow-md), 0 0 20px rgba(212, 169, 65, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--hbc-shadow-lg), 0 0 30px rgba(212, 169, 65, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--hbc-cream);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--hbc-gold);
    border: 2px solid var(--hbc-gold);
}

.btn-outline:hover {
    background: var(--hbc-gold);
    color: var(--hbc-midnight);
}

.btn-icon {
    font-size: 1.2rem;
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--hbc-spacing-sm);
    margin-top: var(--hbc-spacing-md);
}

@media (max-width: 768px) {
    .action-buttons {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   SAVED BIRTHDAYS
   ======================================== */

.saved-birthdays {
    margin-top: var(--hbc-spacing-lg);
    padding-top: var(--hbc-spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.saved-birthdays h3 {
    color: var(--hbc-gold);
    margin-bottom: var(--hbc-spacing-md);
}

.saved-list {
    display: flex;
    flex-direction: column;
    gap: var(--hbc-spacing-sm);
}

.saved-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--hbc-spacing-sm);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--hbc-radius-md);
    cursor: pointer;
    transition: var(--hbc-transition);
    color: var(--hbc-pearl);
}

.saved-item:hover {
    background: rgba(212, 169, 65, 0.2);
    color: var(--hbc-cream);
}

.saved-item-delete {
    color: #FCA5A5;
    cursor: pointer;
    padding: var(--hbc-spacing-xs);
}

/* ========================================
   MODAL
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: var(--hbc-spacing-md);
}

.modal-content {
    background: var(--hbc-deep-space);
    border: 1px solid rgba(212, 169, 65, 0.3);
    border-radius: var(--hbc-radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--hbc-shadow-lg), var(--hbc-shadow-glow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--hbc-spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    margin: 0;
    color: var(--hbc-gold);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--hbc-mist);
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    color: #FCA5A5;
}

.modal-body {
    padding: var(--hbc-spacing-md);
}

.modal-description {
    color: var(--hbc-mist);
    font-size: 0.95rem;
}

.modal-footer {
    display: flex;
    gap: var(--hbc-spacing-sm);
    padding: var(--hbc-spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-footer .btn {
    flex: 1;
}

/* ========================================
   EDUCATIONAL CONTENT
   ======================================== */

.educational-content {
    margin: var(--hbc-spacing-xl) 0;
    padding: var(--hbc-spacing-lg);
    background: linear-gradient(145deg, rgba(30, 48, 80, 0.4), rgba(15, 29, 50, 0.6));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--hbc-radius-lg);
}

.educational-content h2 {
    color: var(--hbc-cream);
    font-family: var(--hbc-font-display);
    margin-top: var(--hbc-spacing-lg);
    margin-bottom: var(--hbc-spacing-md);
}

.educational-content h2:first-child {
    margin-top: 0;
}

.educational-content h3 {
    color: var(--hbc-gold);
    margin-top: var(--hbc-spacing-md);
    margin-bottom: var(--hbc-spacing-sm);
}

.educational-content p {
    color: var(--hbc-pearl);
    line-height: 1.8;
}

.educational-content table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--hbc-spacing-md) 0;
}

.educational-content th,
.educational-content td {
    padding: var(--hbc-spacing-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    color: var(--hbc-pearl);
}

.educational-content th {
    background: rgba(212, 169, 65, 0.1);
    color: var(--hbc-gold);
    font-weight: 600;
}

.educational-content tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.1);
}

/* ========================================
   FAQ SECTION
   ======================================== */

.faq-section {
    margin: var(--hbc-spacing-xl) 0;
}

.faq-section h2 {
    color: var(--hbc-cream);
    font-family: var(--hbc-font-display);
    text-align: center;
    margin-bottom: var(--hbc-spacing-lg);
}

.faq-item {
    margin-bottom: var(--hbc-spacing-md);
    padding: var(--hbc-spacing-md);
    background: linear-gradient(145deg, rgba(30, 48, 80, 0.4), rgba(15, 29, 50, 0.6));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--hbc-radius-md);
    transition: var(--hbc-transition);
}

.faq-item:hover {
    border-color: rgba(212, 169, 65, 0.3);
    box-shadow: var(--hbc-shadow-sm);
}

.faq-question {
    color: var(--hbc-gold);
    margin: 0 0 var(--hbc-spacing-sm) 0;
    font-size: 1.1rem;
}

.faq-answer {
    color: var(--hbc-mist);
    line-height: 1.7;
}

/* ========================================
   RELATED TOOLS
   ======================================== */

.related-tools-section {
    margin: var(--hbc-spacing-xl) 0;
}

.related-tools-section h2 {
    color: var(--hbc-cream);
    font-family: var(--hbc-font-display);
    text-align: center;
    margin-bottom: var(--hbc-spacing-lg);
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--hbc-spacing-md);
}

.related-tool-card {
    padding: var(--hbc-spacing-md);
    background: linear-gradient(145deg, rgba(30, 48, 80, 0.4), rgba(15, 29, 50, 0.6));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--hbc-radius-md);
    text-decoration: none;
    color: inherit;
    transition: var(--hbc-transition);
    display: block;
}

.related-tool-card:hover {
    border-color: rgba(212, 169, 65, 0.3);
    box-shadow: var(--hbc-shadow-md);
    transform: translateY(-2px);
}

.related-tool-card h3 {
    color: var(--hbc-gold);
    margin: 0 0 var(--hbc-spacing-xs) 0;
}

.related-tool-card p {
    color: var(--hbc-mist);
    margin: 0;
    font-size: 0.95rem;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 992px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .feature-highlights {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hijri-birthday-calculator-page {
        padding: var(--hbc-spacing-sm);
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .feature-highlights {
        grid-template-columns: 1fr;
    }

    .steps {
        grid-template-columns: 1fr;
    }

    .hijri-date-large {
        font-size: 1.5rem;
    }

    .age-display {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .hero-section {
        padding: var(--hbc-spacing-md);
    }

    .language-switcher {
        gap: var(--hbc-spacing-xs);
    }

    .lang-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
    }
}

/* ========================================
   PRINT & ACCESSIBILITY
   ======================================== */

@media print {
    .language-switcher,
    .action-buttons,
    .related-tools-section,
    #reset-btn,
    .modal {
        display: none !important;
    }

    .hijri-birthday-calculator-page {
        max-width: 100%;
        padding: 0;
    }

    body { background: white; color: black; }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

*:focus-visible {
    outline: 3px solid var(--hbc-gold);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

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

.text-muted {
    color: var(--hbc-mist);
}

.mb-sm {
    margin-bottom: var(--hbc-spacing-sm);
}

.mb-md {
    margin-bottom: var(--hbc-spacing-md);
}

.mb-lg {
    margin-bottom: var(--hbc-spacing-lg);
}

.hidden {
    display: none !important;
}

/* ========================================
   SHAREABLE BIRTHDAY CARD STYLES
   ======================================== */

/* Card Modal - Large Size */
.modal-large {
    max-width: 900px;
    width: 95%;
}

.card-creator-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--hbc-spacing-lg);
}

@media (max-width: 768px) {
    .card-creator-body {
        grid-template-columns: 1fr;
    }
}

/* Card Template Selection */
.card-templates-section h4,
.card-preview-section h4 {
    color: var(--hbc-gold);
    font-size: 1rem;
    margin-bottom: var(--hbc-spacing-sm);
    font-weight: 600;
}

.card-templates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--hbc-spacing-sm);
    margin-bottom: var(--hbc-spacing-md);
}

.card-template-btn {
    background: var(--hbc-surface);
    border: 2px solid var(--hbc-border);
    border-radius: var(--hbc-radius-md);
    padding: var(--hbc-spacing-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--hbc-spacing-xs);
}

.card-template-btn:hover {
    border-color: var(--hbc-gold);
}

.card-template-btn.active {
    border-color: var(--hbc-gold);
    background: rgba(212, 169, 65, 0.1);
}

.template-preview {
    width: 60px;
    height: 80px;
    border-radius: var(--hbc-radius-sm);
    display: block;
}

.celestial-preview {
    background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 50%, #2D1B4E 100%);
}

.elegant-preview {
    background: linear-gradient(135deg, #1A1A2E 0%, #16213E 100%);
    border: 1px solid #D4A941;
}

.festive-preview {
    background: linear-gradient(135deg, #10B981 0%, #3B82F6 50%, #8B5CF6 100%);
}

.minimal-preview {
    background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
}

.template-name {
    color: var(--hbc-silver);
    font-size: 0.85rem;
}

/* Card Customization */
.card-customization-section {
    margin-bottom: var(--hbc-spacing-md);
}

.card-customization-section .form-group {
    margin-bottom: var(--hbc-spacing-sm);
}

.card-customization-section textarea {
    resize: none;
}

/* Card Preview Section */
.card-preview-section {
    grid-column: 1 / -1;
}

.birthday-card-preview {
    display: flex;
    justify-content: center;
    padding: var(--hbc-spacing-md);
    background: var(--hbc-dark-space);
    border-radius: var(--hbc-radius-lg);
}

/* Birthday Card Base Styles */
.birthday-card {
    width: 400px;
    min-height: 520px;
    border-radius: var(--hbc-radius-lg);
    padding: var(--hbc-spacing-lg);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

@media (max-width: 480px) {
    .birthday-card {
        width: 100%;
        min-width: 280px;
        min-height: 400px;
        padding: var(--hbc-spacing-md);
    }
}

/* Card Decorations */
.card-decorations {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.card-moon {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2.5rem;
    opacity: 0.8;
    animation: moonGlow 3s ease-in-out infinite;
}

.card-stars {
    position: absolute;
    top: 25px;
    left: 25px;
    font-size: 1.5rem;
    opacity: 0.6;
}

@keyframes moonGlow {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
}

/* Card Header */
.card-header {
    position: relative;
    z-index: 1;
    padding-bottom: var(--hbc-spacing-sm);
    border-bottom: 1px solid rgba(212, 169, 65, 0.3);
    margin-bottom: var(--hbc-spacing-md);
}

.card-bismillah {
    font-family: 'Noto Kufi Arabic', serif;
    font-size: 1.5rem;
    color: var(--hbc-gold);
    display: block;
}

/* Card Body */
.card-body {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--hbc-spacing-sm);
}

.card-title {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--hbc-gold);
    margin: 0;
}

.card-recipient-display {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: var(--hbc-spacing-sm) 0;
}

.card-date-display {
    margin: var(--hbc-spacing-md) 0;
}

.card-hijri-date {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--hbc-gold);
    margin: 0 0 var(--hbc-spacing-xs) 0;
}

.card-gregorian-date {
    font-size: 1rem;
    color: var(--hbc-silver);
    margin: 0;
}

.card-age-display {
    font-size: 1.1rem;
    color: var(--hbc-mist);
    margin: var(--hbc-spacing-sm) 0;
}

.card-age-display strong {
    color: var(--hbc-gold);
    font-size: 1.4rem;
}

.card-message-display {
    font-size: 1rem;
    color: var(--hbc-silver);
    font-style: italic;
    margin-top: var(--hbc-spacing-md);
    padding: 0 var(--hbc-spacing-sm);
    line-height: 1.5;
}

/* Card Footer */
.card-footer {
    position: relative;
    z-index: 1;
    padding-top: var(--hbc-spacing-sm);
    border-top: 1px solid rgba(212, 169, 65, 0.3);
    margin-top: auto;
}

.card-branding {
    font-size: 0.8rem;
    color: var(--hbc-mist);
    opacity: 0.7;
}

/* ========================================
   CARD TEMPLATES
   ======================================== */

/* Celestial Template (Default) */
.celestial-card {
    background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 50%, #2D1B4E 100%);
}

.celestial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.2), transparent),
        radial-gradient(2px 2px at 50px 160px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 90px 40px, rgba(255,255,255,0.2), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.2), transparent),
        radial-gradient(3px 3px at 200px 50px, rgba(212,169,65,0.4), transparent),
        radial-gradient(2px 2px at 250px 90px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 300px 60px, rgba(255,255,255,0.2), transparent),
        radial-gradient(2px 2px at 350px 130px, rgba(255,255,255,0.3), transparent);
    pointer-events: none;
    z-index: 0;
}

/* Elegant Template */
.elegant-card {
    background: linear-gradient(180deg, #1A1A2E 0%, #16213E 100%);
    border: 2px solid var(--hbc-gold);
}

.elegant-card .card-decorations {
    display: none;
}

.elegant-card::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid rgba(212, 169, 65, 0.3);
    border-radius: var(--hbc-radius-md);
    pointer-events: none;
}

.elegant-card .card-bismillah {
    font-size: 1.8rem;
}

.elegant-card .card-title {
    letter-spacing: 5px;
}

.elegant-card .card-recipient-display {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem;
}

/* Festive Template */
.festive-card {
    background: linear-gradient(135deg, #10B981 0%, #3B82F6 50%, #8B5CF6 100%);
}

.festive-card .card-moon {
    animation: bounce 1s ease-in-out infinite;
}

.festive-card .card-stars {
    animation: sparkle 0.8s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes sparkle {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.festive-card .card-bismillah {
    color: white;
}

.festive-card .card-header {
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.festive-card .card-title {
    color: white;
}

.festive-card .card-hijri-date {
    color: #FEF3C7;
}

.festive-card .card-footer {
    border-top-color: rgba(255, 255, 255, 0.3);
}

/* Minimal Template */
.minimal-card {
    background: linear-gradient(180deg, #F8FAFC 0%, #E2E8F0 100%);
    color: #1E293B;
}

.minimal-card .card-decorations {
    display: none;
}

.minimal-card .card-header {
    border-bottom-color: rgba(30, 41, 59, 0.2);
}

.minimal-card .card-bismillah {
    color: #1E3A5F;
}

.minimal-card .card-title {
    color: #1E3A5F;
}

.minimal-card .card-recipient-display {
    color: #0F172A;
}

.minimal-card .card-hijri-date {
    color: #D4A941;
}

.minimal-card .card-gregorian-date {
    color: #64748B;
}

.minimal-card .card-age-display {
    color: #475569;
}

.minimal-card .card-age-display strong {
    color: #D4A941;
}

.minimal-card .card-message-display {
    color: #64748B;
}

.minimal-card .card-footer {
    border-top-color: rgba(30, 41, 59, 0.2);
}

.minimal-card .card-branding {
    color: #94A3B8;
}

/* RTL Support for Cards */
[dir="rtl"] .birthday-card {
    direction: rtl;
}

[dir="rtl"] .card-moon {
    right: auto;
    left: 20px;
}

[dir="rtl"] .card-stars {
    left: auto;
    right: 25px;
}
