/* Persian Color Scheme */
:root {
    /* Primary Colors */
    --maroon: #8B1E3F;
    --maroon-light: #b84a6c;
    --maroon-dark: #5e142b;
    
    /* Secondary Colors */
    --green: #0A5C36;
    --green-light: #0d7a4a;
    --green-dark: #084528;
    
    /* Accent Colors */
    --turquoise: #2D9B9B;
    --turquoise-light: #38c2c2;
    --turquoise-dark: #247a7a;
    
    /* Background Colors */
    --cream: #FFFBF0;
    --cream-light: #fffff8;
    --cream-dark: #f5f0e1;
    
    /* Text Colors */
    --gold: #D4B483;
    --gold-light: #e9d4b5;
    --gold-dark: #b8965e;
    
    /* Neutral Colors */
    --text-dark: #2C3E50;
    --text-light: #FFFFFF;
    --text-secondary: #666666;
    
    /* Shadows */
    --shadow: 0 2px 8px rgba(139, 30, 63, 0.1);
    --shadow-lg: 0 4px 16px rgba(139, 30, 63, 0.15);
    
    /* Fonts */
    --font-arabic: 'Amiri', serif;
    --font-urdu: 'Noto Nastaliq Urdu', serif;
    --font-latin: 'Tajawal', sans-serif;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

/* Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-latin);
    background-color: var(--cream);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--maroon), var(--maroon-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity var(--transition-slow);
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}

.bismillah-loading {
    font-size: 4rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* App Container */
#app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Language Toggle */
.language-toggle {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--cream);
    padding: 1rem 0;
    border-bottom: 2px solid var(--gold);
    backdrop-filter: blur(10px);
    background: rgba(255, 251, 240, 0.95);
}

.lang-btn-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.lang-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--turquoise);
    background: var(--cream);
    color: var(--turquoise);
    border-radius: 2rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
    min-height: 44px; /* Touch target size */
}

.lang-btn.active {
    background: var(--turquoise);
    color: var(--text-light);
}

.lang-btn:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

/* App Header */
.app-header {
    background: linear-gradient(135deg, var(--maroon), var(--maroon-dark));
    color: var(--text-light);
    padding: 2rem 1rem;
    text-align: center;
    border-radius: 0 0 1.5rem 1.5rem;
    margin: 0 -1rem 2rem;
}

.bismillah {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.app-header h1 {
    font-family: var(--font-arabic);
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Date Section */
.date-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.date-card {
    background: var(--cream);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    border-top: 4px solid transparent;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.date-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.hijri-date {
    border-top-color: var(--green);
}

.gregorian-date {
    border-top-color: var(--turquoise);
}

.date-icon {
    width: 3rem;
    height: 3rem;
    background: var(--maroon);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hijri-date .date-icon {
    background: var(--green);
}

.gregorian-date .date-icon {
    background: var(--turquoise);
}

.date-icon i {
    color: var(--gold);
    font-size: 1.3rem;
}

.date-content {
    flex: 1;
    text-align: left;
}

.date-content h3 {
    font-size: 0.9rem;
    color: var(--turquoise);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.arabic-date {
    font-family: var(--font-arabic);
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.english-date {
    font-size: 1rem;
    color: var(--green);
    opacity: 0.9;
}

/* Toggle List */
.toggle-list {
    margin-bottom: 3rem;
}

.toggle-item {
    background: var(--cream);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    border: 2px solid transparent;
    transition: border-color var(--transition-normal);
}

.toggle-item.active {
    border-color: var(--maroon);
}

.toggle-header {
    width: 100%;
    padding: 1.25rem;
    background: var(--cream);
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    text-align: left;
    min-height: 60px; /* Touch target size */
}

.toggle-item.active .toggle-header {
    background: linear-gradient(135deg, var(--maroon), var(--maroon-dark));
    color: var(--text-light);
}

.toggle-header:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: -2px;
}

.toggle-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.toggle-title i {
    font-size: 1.3rem;
    color: var(--turquoise);
    width: 1.5rem;
    text-align: center;
}

.toggle-item.active .toggle-title i {
    color: var(--gold);
}

.toggle-title h3 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.day-info, .date-info {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: normal;
}

.toggle-arrow {
    transition: transform var(--transition-normal);
    transform: rotate(0deg);
}

.toggle-item.active .toggle-arrow {
    transform: rotate(180deg);
    color: var(--gold);
}

/* In your style.css, update these rules: */

.toggle-content {
    display: none;
    transition: opacity var(--transition-normal) ease;
    opacity: 0;
}

.toggle-item.active .toggle-content {
    display: block;
    opacity: 1;
}

/* Remove or comment out these lines if they exist: */
/*
.toggle-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal) ease;
}

.toggle-item.active .toggle-content {
    max-height: 5000px;
}
*/
/* Force proper Urdu rendering */
.ur,
[lang="ur"],
.urdu-text {
    font-family: var(--font-urdu) !important;
    direction: rtl;
    text-align: right;
    line-height: 2.1;
    word-spacing: 0.15em;
}


/* Supplications List */
.supplications-list {
    padding: 1.5rem;
}

.supplication-item {
    background: var(--cream);
    border-radius: 0.75rem;
    padding: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-left: 4px solid var(--maroon);
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.supplication-item:last-child {
    margin-bottom: 0;
}

.supplication-item:hover {
    transform: translateX(4px);
    border-left-color: var(--green);
    box-shadow: var(--shadow-lg);
}

.supplication-item:active {
    transform: translateX(2px);
}

.supplication-item h3 {
    font-size: 1.3rem;
    color: var(--maroon);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.supplication-item p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.supplication-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--turquoise);
    font-size: 0.9rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(139, 30, 63, 0.1);
}

.time-estimate {
    background: rgba(45, 155, 155, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: 500;
}

/* Loading States */
.loading-small {
    text-align: center;
    padding: 2rem;
    color: var(--maroon);
}

.small-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(139, 30, 63, 0.1);
    border-top: 3px solid var(--maroon);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* Full View Overlay */
.full-view-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.full-view-overlay[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.full-view-content {
    background: var(--cream);
    border-radius: 1.5rem;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s ease;
}

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

.close-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--maroon);
    color: var(--text-light);
    border: none;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
    z-index: 10;
    min-height: 44px; /* Touch target */
}

.close-btn:hover {
    background: var(--maroon-dark);
    transform: rotate(90deg);
}

.full-view-header {
    text-align: center;
    padding: 3rem 2rem 1.5rem;
    border-bottom: 2px solid var(--gold);
}

.full-view-header h1 {
    font-size: 1.8rem;
    color: var(--maroon);
    margin-bottom: 1rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.full-view-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    color: var(--turquoise);
    font-size: 1rem;
    flex-wrap: wrap;
}

.category-tag {
    background: rgba(10, 92, 54, 0.1);
    padding: 0.25rem 1rem;
    border-radius: 1rem;
}

.full-view-body {
    padding: 2rem;
}

.arabic-text-section {
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.arabic-text-section h3 {
    color: var(--green);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.arabic-text {
    font-family: var(--font-arabic), 'Amiri', 'Scheherazade New', serif;
    font-size: 2.5rem;
    line-height: 2.2;
    color: var(--text-dark);
    padding: 1.5rem;
    background: rgba(212, 180, 131, 0.1);
    border-radius: 1rem;
    border-right: 4px solid var(--gold);

    direction: rtl;
    text-align: right;

    letter-spacing: 0;
    word-spacing: 0.1em;

    white-space: pre-wrap;
    unicode-bidi: isolate;
}

.arabic-text::selection {
    background: rgba(212, 180, 131, 0.4);
}


.steps-section {
    background: rgba(10, 92, 54, 0.05);
    padding: 1.5rem;
    border-radius: 1rem;
    border-left: 4px solid var(--green);
    margin-top: 2rem;
}
/* Update the steps section styling */
.steps-section h3 {
    color: var(--maroon);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.steps-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-dark);
}

.steps-text p {
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(139, 30, 63, 0.1);
}

.steps-text p:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

/* If you want a different style for steps, you can use this alternative: */
.steps-text-alt {
    background: rgba(212, 180, 131, 0.1);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border-left: 4px solid var(--gold);
}

.steps-text-alt p {
    margin-bottom: 1rem;
    position: relative;
    padding-left: 1.5rem;
}

.steps-text-alt p:before {
    content: "•";
    color: var(--maroon);
    font-size: 1.5rem;
    position: absolute;
    left: 0;
    top: -0.2rem;
}

.steps-text-alt p:last-child {
    margin-bottom: 0;
}

.full-view-actions {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(139, 30, 63, 0.1);
    background: var(--cream-dark);
    border-radius: 0 0 1.5rem 1.5rem;
}

.action-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    background: var(--cream);
    border: 2px solid var(--maroon);
    color: var(--maroon);
    border-radius: 2rem;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
    min-height: 44px; /* Touch target */
}

.action-btn:hover {
    background: rgba(139, 30, 63, 0.1);
}

/* Error Message */
.error-message {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--maroon);
    color: var(--text-light);
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-width: 90%;
    text-align: center;
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid rgba(139, 30, 63, 0.1);
}

.footer-note {
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .date-section {
        grid-template-columns: 1fr;
    }
    
    .app-header h1 {
        font-size: 1.8rem;
    }
    
    .bismillah {
        font-size: 2.5rem;
    }
    
    .arabic-text {
        font-size: 2.5rem;
        line-height: 1.8;
    }
    
    .full-view-content {
        max-height: 95vh;
    }
}

@media (max-width: 480px) {
    .toggle-title h3 {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .day-info, .date-info {
        font-size: 0.9rem;
    }
    
    .full-view-body {
        padding: 1rem;
    }
    
    .arabic-text {
        font-size: 2.5rem;
        padding: 2.2rem;
    }
    
    .action-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    .language-toggle,
    .toggle-arrow,
    .close-btn,
    .full-view-actions,
    .footer {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .toggle-item {
        break-inside: avoid;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
    
    .toggle-header {
        background: white !important;
        color: black !important;
    }
    
    .full-view-overlay {
        position: static;
        background: white;
    }
    
    .full-view-content {
        box-shadow: none;
        max-height: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --maroon: #8B0000;
        --green: #006400;
        --turquoise: #008080;
        --text-dark: #000000;
    }
    
    .supplication-item {
        border-left-width: 3px;
    }
}

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

/* Share Today's Collection Section */
.share-section {
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    border-radius: 1.5rem;
    padding: 1.5rem;
    margin: 2rem 0;
    color: var(--text-light);
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--gold);
}

.share-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.share-header i {
    font-size: 1.8rem;
    color: var(--gold);
}

.share-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

.share-content p {
    opacity: 0.9;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.6;
}

.share-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.share-btn {
    flex: 1;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
    min-height: 50px;
}

.copy-all-btn {
    background: var(--cream);
    color: var(--maroon);
}

.copy-all-btn:hover {
    background: var(--gold-light);
    transform: translateY(-2px);
}

.whatsapp-btn {
    background: #25D366;
    color: white;
}

.whatsapp-btn:hover {
    background: #128C7E;
    transform: translateY(-2px);
}

.share-preview {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid rgba(212, 180, 131, 0.3);
    max-height: 200px;
    overflow-y: auto;
    font-family: var(--font-arabic);
    font-size: 1.1rem;
    line-height: 1.8;
    white-space: pre-line;
    backdrop-filter: blur(10px);
}

/* Responsive */
@media (max-width: 768px) {
    .share-actions {
        flex-direction: column;
    }
    
    .share-btn {
        width: 100%;
    }
    
    .share-preview {
        max-height: 150px;
        font-size: 1rem;
    }
}
