/* Core Application Styles */
:root {
    /* Modern Apple-like Palette */
    --bg-body: #000000;
    --bg-sidebar: #1C1C1E;
    --bg-card: #1C1C1E;
    --bg-card-hover: #2C2C2E;

    --text-primary: #FFFFFF;
    --text-secondary: #8E8E93;
    --text-tertiary: #48484A;

    --accent-blue: #0A84FF;
    --accent-green: #30D158;
    --accent-orange: #FF9F0A;
    --accent-purple: #BF5AF2;
    --accent-red: #FF375F;

    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(28, 28, 30, 0.85);

    --radius-l: 20px;
    --radius-m: 14px;
    --radius-s: 10px;

    --sidebar-width: 250px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Layout */
.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    position: relative;
    scrollbar-width: none;
}

/* Transitions & Animation */
.view-container {
    max-width: 1200px;
    margin: 0 auto;
    display: none;
    animation: fadeIn 0.4s ease;
}

.view-container.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

.grid-col {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-l);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.hero-card {
    background: linear-gradient(120deg, var(--accent-blue), var(--accent-purple));
    border: none;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-content h2 {
    font-size: 38px;
    font-weight: 800;
    margin: 5px 0 15px;
}

.hero-label {
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
    opacity: 0.8;
}

.countdown-pill {
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.hero-icon {
    font-size: 60px;
    opacity: 0.8;
}

/* Prayer Rows */
.prayer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.prayer-row:last-child {
    border-bottom: none;
}

.prayer-name {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
    font-size: 16px;
}

.prayer-icon-small {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
    font-size: 14px;
}

.prayer-time {
    font-family: 'SF Mono', monospace;
    font-weight: 500;
    color: var(--text-secondary);
}

.prayer-row.active {
    background-color: rgba(48, 209, 88, 0.1);
    padding: 16px;
    border-radius: var(--radius-m);
    margin: 5px 0;
    border-bottom: none;
}

.prayer-row.active .prayer-icon-small {
    background-color: var(--accent-green);
    color: white;
}

.prayer-row.active .prayer-time {
    color: var(--accent-green);
    font-weight: 700;
}

/* Tracker Circle */
.tracker-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-tertiary);
}

.tracker-circle i {
    font-size: 16px;
    margin-bottom: 2px;
    display: none;
}

.tracker-circle span {
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 700;
}

.tracker-circle.checked {
    background-color: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
}

.tracker-circle.checked i {
    display: block;
}

.tracker-circle.checked span {
    display: none;
}

/* Grid & Action Cards */
.scroll-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
}

.action-card {
    background-color: var(--bg-card-hover);
    border-radius: var(--radius-m);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 15px;
    cursor: pointer;
    transition: transform 0.2s;
}

.action-card:hover {
    background-color: #38383a;
    transform: translateY(-2px);
}

.action-icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
}

/* Surahs */
.surah-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.surah-card-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: var(--radius-m);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.surah-card-item:hover {
    background-color: var(--bg-card-hover);
}

.surah-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.surah-badge {
    background-color: var(--bg-card-hover);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--accent-green);
}

/* Components: Tasbih, Qibla, Guides */
.tasbih-circle {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, #2C2C2E, #000000);
    border: 4px solid var(--bg-card-hover);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    user-select: none;
    transition: transform 0.1s;
}

.tasbih-circle:active {
    transform: scale(0.95);
    border-color: var(--accent-blue);
}

#tasbih-count {
    font-size: 80px;
    font-weight: 700;
    font-family: 'SF Mono', monospace;
}

.tasbih-controls {
    margin-top: 40px;
}

.tasbih-btn {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border: none;
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 16px;
    cursor: pointer;
}

/* Rich Guide Styles */
.guide-step-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-l);
    overflow: hidden;
    margin-bottom: 25px;
    display: flex;
    align-items: stretch;
}

.guide-image-container {
    width: 350px;
    min-height: 250px;
    background-color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.guide-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: transform 0.3s;
}

.guide-step-card:hover .guide-image-container img {
    transform: scale(1.05);
}

.guide-content {
    padding: 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.compass-visual {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    position: relative;
    background: radial-gradient(circle, #222, #111);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.compass-needle {
    width: 6px;
    height: 110px;
    background: var(--accent-red);
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(0deg);
    border-radius: 3px;
    z-index: 2;
}

.compass-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
}

/* Toggle Switch Styles */
.toggle-switch {
    width: 50px;
    height: 30px;
    background: #38383a;
    border-radius: 15px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-switch.checked {
    background: #34c759;
}

.toggle-switch::after {
    content: '';
    width: 26px;
    height: 26px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.toggle-switch.checked::after {
    transform: translateX(20px);
}

/* Responsive adjustments for main content */
@media (max-width: 768px) {
    .main-content {
        padding: 20px;
        padding-bottom: 100px;
    }

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

    .guide-step-card {
        flex-direction: column;
    }

    .guide-image-container {
        width: 100%;
        height: 220px;
        min-height: auto;
    }
}