* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Hind Siliguri', sans-serif;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    background-color: #0b1120;
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
}

/* Noor Light Effect */
.noor-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(147, 197, 253, 0.2) 0%, rgba(11, 17, 32, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    z-index: 0;
}

.noor-active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(2.5);
    background: radial-gradient(circle, rgba(191, 219, 254, 0.4) 0%, rgba(14, 165, 233, 0.1) 40%, rgba(11, 17, 32, 0) 70%);
}

.noor-milestone {
    opacity: 1;
    transform: translate(-50%, -50%) scale(3.5);
    background: radial-gradient(circle, rgba(253, 230, 138, 0.5) 0%, rgba(217, 119, 6, 0.2) 40%, rgba(11, 17, 32, 0) 70%);
}

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 500px;
    padding: 1rem 1rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 0.5rem;
}

header h1 {
    font-size: 1.5rem;
    color: #bae6fd;
    font-weight: 600;
}

header p {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

/* Search Bar Styles */
.search-container {
    position: relative;
    margin-top: 1rem;
    width: 100%;
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
    z-index: 10;
}

#searchInput {
    width: 100%;
    padding: 12px 20px;
    border-radius: 25px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    background: rgba(15, 23, 42, 0.8);
    color: #e2e8f0;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    text-align: center;
}

#searchInput:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    margin-top: 5px;
    list-style: none;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    text-align: left;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.search-results.active {
    display: block;
}

.search-results li {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    color: #bae6fd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.search-results li:last-child {
    border-bottom: none;
}

.search-results li:hover {
    background: rgba(56, 189, 248, 0.1);
}

.search-ar {
    font-family: 'Amiri', serif;
    color: #fbbf24;
    font-size: 1.2rem;
}

.problem-select {
    width: 100%;
    padding: 10px 15px;
    margin-top: 10px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: #e2e8f0;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    outline: none;
    transition: all 0.3s ease;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23bae6fd%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 12px auto;
}

.problem-select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.problem-select option {
    background: #1e293b;
    color: #e2e8f0;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

/* Glassmorphism Card for Asma ul Husna */
.asma-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1rem;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.3s ease;
}

.arabic-name-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 0.2rem;
}

.arabic-name {
    font-family: 'Amiri', serif;
    font-size: 2.8rem;
    color: #fbbf24;
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
}

.nav-btn {
    background: transparent;
    border: none;
    color: rgba(186, 230, 253, 0.5);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    padding: 0 5px;
}

.nav-btn:hover {
    color: #fbbf24;
    transform: scale(1.2);
}

.action-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 0;
    margin-bottom: 0.5rem;
    width: 100%;
}

.action-btn {
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(56, 189, 248, 0.4);
    transform: scale(1.1);
}

.active-repeat {
    background: rgba(16, 185, 129, 0.4) !important;
    border-color: #10b981 !important;
    text-shadow: 0 0 10px #10b981;
}

.bangla-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 0.2rem;
}

.meaning {
    font-size: 0.9rem;
    color: #cbd5e1;
}

/* Counter Area */
.counter-container {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle at top left, #1e293b, #0f172a);
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(56, 189, 248, 0.1),
        0 10px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    border: 2px solid rgba(56, 189, 248, 0.2);
    transition: transform 0.1s ease;
}

.counter-container:active {
    transform: scale(0.96);
}

.counter-value {
    font-size: 3.5rem;
    font-weight: 700;
    color: #38bdf8;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
}

.instruction {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 5px;
}

/* Ripple effect on tap */
.ripple {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #38bdf8;
    opacity: 0;
    transform: scale(1);
}

.ripple-active {
    animation: rippleAnim 0.6s ease-out;
}

@keyframes rippleAnim {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.4); opacity: 0; }
}

.controls-row {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.reset-wrapper {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    width: 100%;
}

.autoplay-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(30, 41, 59, 0.5);
    padding: 10px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.loop-input {
    width: 60px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #334155;
    color: #38bdf8;
    padding: 8px;
    border-radius: 15px;
    text-align: center;
    font-size: 1rem;
    outline: none;
}

.loop-input:focus {
    border-color: #38bdf8;
}

.auto-btn {
    background: rgba(56, 189, 248, 0.2);
    color: #bae6fd;
    border-color: rgba(56, 189, 248, 0.4);
}

.auto-btn:hover {
    background: rgba(56, 189, 248, 0.4);
}

.stop-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.4);
}

.stop-btn:hover {
    background: rgba(239, 68, 68, 0.4);
}

.btn {
    background: transparent;
    color: #64748b;
    border: 1px solid #334155;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover, .btn:active {
    background: #334155;
    color: #e2e8f0;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 17, 32, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    text-align: center;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #ef4444;
}

.modal-title-ar {
    font-family: 'Amiri', serif;
    font-size: 2.5rem;
    color: #fbbf24;
    margin-bottom: 0.5rem;
}

.modal-title-bn {
    font-size: 1.5rem;
    color: #e2e8f0;
    margin-bottom: 1rem;
}

.modal-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.5), transparent);
    margin: 1rem 0;
}

.modal-text {
    color: #cbd5e1;
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: justify;
    white-space: pre-wrap;
}
