/* Main Styles for Athkar App - Optimized for Performance */

/* CSS Variables for consistent theming */
:root {
    --primary-color: #4CAF50;
    --primary-dark: #388E3C;
    --secondary-color: #FFC107;
    --background-color: #f5f5f5;
    --card-background: #ffffff;
    --text-color: #333333;
    --text-light: #777777;
    --border-color: #e0e0e0;
    --border-color-light: #f0f0f0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --border-radius: 16px;
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --header-bg-color: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --primary-color: #4CAF50;
    --primary-dark: #2E7D32;
    --secondary-color: #FFC107;
    --background-color: #121212;
    --card-background: #1e1e1e;
    --text-color: #ffffff;
    --text-light: #bbbbbb;
    --border-color: #333333;
    --border-color-light: #2a2a2a;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .athkar-card .card-body,
[data-theme="dark"] .athkar-card .card-body .athkar-text {
    color: var(--text-color);
}

[data-theme="dark"] .athkar-card .card-body .athkar-reference {
    color: #ffffff;
    opacity: 1;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
    font-weight: 500;
}

[data-theme="dark"] .athkar-card .card-body .athkar-fadl {
    color: var(--text-color);
    opacity: 1;
    font-weight: 400;
}

[data-theme="dark"] .modal-content,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-check-input {
    background-color: var(--card-background);
    color: var(--text-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .modal-title,
[data-theme="dark"] .form-label,
[data-theme="dark"] .form-check-label {
    color: var(--text-color);
}

[data-theme="dark"] .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

[data-theme="dark"] .btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

[data-theme="dark"] .btn-secondary {
    background-color: var(--border-color);
    border-color: var(--border-color);
    color: var(--text-color);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    -webkit-overflow-scrolling: touch;
}

/* App Container */
#app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 0;
}

/* Header Styles */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    text-align: center;
    padding: 0.5rem 0;
    background: var(--header-bg-color);
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 0;
    min-height: 45px;
}

.app-header h1 {
    font-size: 1.1rem;
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
}

.app-header p {
    font-size: 0.75rem;
    opacity: 0.9;
    margin: 0;
    line-height: 1.2;
}

.settings-toggle, .btn-outline-light {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    min-width: 42px;
    -webkit-tap-highlight-color: transparent;
    margin: 0 0.25rem;
}

.settings-toggle:hover, .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.settings-toggle:active, .btn-outline-light:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.4);
}

.settings-toggle i, .btn-outline-light i {
    font-size: 1.2rem;
}

/* Main Content Area */
main#athkar-display, main#quran-container {
    flex: 1;
    overflow-y: auto;
    padding: calc(55px + env(safe-area-inset-top)) var(--spacing-md) calc(80px + env(safe-area-inset-bottom));
    margin-bottom: 0;
    -webkit-overflow-scrolling: touch;
}

main#athkar-display {
    padding: calc(55px + env(safe-area-inset-top)) var(--spacing-md) calc(80px + env(safe-area-inset-bottom));
}

main#quran-container {
    padding: calc(55px + env(safe-area-inset-top)) var(--spacing-md) calc(80px + env(safe-area-inset-bottom));
}

/* About page specific styles */
main.container.my-5 {
    padding-bottom: 80px;
}

.athkar-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    width: 100%;
    max-width: 100%;
    animation: fadeIn 0.5s ease;
    border: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 60vh;
    align-items: center;
}

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

.athkar-text {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-lg);
    line-height: 1.8;
    font-weight: 500;
    padding: 0 var(--spacing-md);
    text-align: center;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    font-feature-settings: "liga" 1;
    letter-spacing: 0.01em;
    white-space: normal;
    width: 100%;
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 95%;
}

.athkar-reference {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    font-style: normal;
    text-align: center;
    padding: 0 var(--spacing-md);
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    font-feature-settings: "liga" 1;
    letter-spacing: 0.02em;
    font-weight: 400;
    width: 100%;
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.athkar-fadl {
    font-size: 1.15rem;
    color: var(--text-color);
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-sm) var(--spacing-md);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    font-style: normal;
    text-align: center;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    font-feature-settings: "liga" 1;
    letter-spacing: 0.01em;
    font-weight: 400;
    width: 100%;
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
}

/* Counter Section */
.counter {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    padding: 0 var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.counter-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.counter-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.counter-btn:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

.counter-btn:active {
    transform: scale(0.95);
    background-color: var(--primary-dark);
}

.counter-btn i {
    font-size: 1.3rem;
}

/* Button Styles */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

.btn-primary:focus,
.btn-primary:active {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 0.25rem rgba(76, 175, 80, 0.25);
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

[data-theme="dark"] .btn-secondary {
    background-color: var(--border-color);
    border-color: var(--border-color);
    color: var(--text-color);
}

/* Form Check Input Styles (Switches) */
.form-check-input {
    border-color: var(--border-color);
    height: 1.5em;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(76, 175, 80, 0.25);
}

.form-check-input:checked:focus {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(76, 175, 80, 0.25);
}

.form-switch .form-check-input {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e");
    border-radius: 2em;
    transition: background-position 0.15s ease-in-out;
}

.form-switch .form-check-input:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    background-position: right center;
}

[data-theme="dark"] .form-switch .form-check-input {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%28255, 255, 255, 0.25%29'/%3e%3c/svg%3e");
}

[data-theme="dark"] .form-switch .form-check-input:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.form-check-label {
    color: var(--text-color);
    font-weight: 400;
    margin-right: 0.5rem;
}

.form-check-input:disabled {
    background-color: #e9ecef;
    opacity: 0.5;
}

[data-theme="dark"] .form-check-input:disabled {
    background-color: #6c757d;
    opacity: 0.5;
}

/* Responsive Adjustments for Form Elements */
@media (max-width: 576px) {
    .form-check-input {
        height: 1.5em;
        width: 2.5em;
    }
    
    .form-switch .form-check-input {
        height: 1.5em;
        width: 2.5em;
    }
    
    .form-check-label {
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .form-check-input {
        height: 1.4em;
        width: 2.4em;
    }
    
    .form-switch .form-check-input {
        height: 1.4em;
        width: 2.4em;
    }
    
    .form-check-label {
        font-size: 0.85rem;
    }
}

/* Modal Styles */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    border-radius: 16px 16px 0 0;
    padding: 1rem;
    position: relative;
    flex-shrink: 0;
}

.modal-body {
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 16px 16px;
    padding: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.modal-footer .btn {
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    border-radius: 8px;
    min-width: 100px;
    min-height: 44px;
}

.modal-footer .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.modal-footer .btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.modal-footer .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

[data-theme="dark"] .modal-footer .btn-secondary {
    background-color: var(--border-color);
    border-color: var(--border-color);
    color: var(--text-color);
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    position: absolute;
    left: 1rem;
    top: 0.75rem;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

[data-theme="dark"] .modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Responsive Adjustments for Modals */
.modal-dialog {
    margin: 1.75rem;
    max-width: 500px;
    height: auto;
    width: calc(100% - 3.5rem);
}

.modal-dialog-centered {
    min-height: calc(100% - 3.5rem);
}

.modal-dialog-scrollable {
    max-height: calc(100% - 3.5rem);
}

.modal-dialog-scrollable .modal-content {
    max-height: calc(100vh - 3.5rem);
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .modal-dialog {
        max-width: 550px;
        margin: 1.75rem auto;
        width: auto;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (max-width: 991.98px) {
    .modal-dialog {
        max-width: 90%;
        margin: 1.75rem auto;
        width: calc(100% - 3.5rem);
    }
    
    .modal-content {
        border-radius: 14px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.875rem;
    }
    
    .modal-footer .btn {
        min-width: 90px;
        padding: 0.45rem 1.25rem;
    }
    
    .modal-title {
        font-size: 1.15rem;
    }
    
    .modal-body {
        padding: 0.875rem;
        max-height: 55vh;
    }
    
    .modal-body .form-check-input {
        width: 2.5em;
        height: 1.5em;
    }
    
    .modal-body .form-label {
        font-size: 0.95rem;
    }
    
    .modal-body .form-control {
        padding: 0.65rem;
        font-size: 0.95rem;
    }
    
    .developer-info {
        font-size: 1rem;
        padding: 0.65rem 0;
        margin-top: 0.65rem;
    }
    
    .developer-info a {
        font-size: 1rem;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (max-width: 767.98px) {
    .modal-dialog {
        max-width: 90%;
        margin: 1.75rem auto;
        width: calc(100% - 3.5rem);
    }
    
    .modal-content {
        border-radius: 12px;
        max-height: 85vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.75rem;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-close-btn {
        font-size: 1.1rem;
        padding: 0.4rem;
        left: 0.75rem;
        top: 0.75rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        min-width: auto;
        margin-bottom: 0.5rem;
        padding: 0.5rem;
    }
    
    .modal-footer .btn:last-child {
        margin-bottom: 0;
    }
    
    main#quran-container {
        padding: calc(55px + env(safe-area-inset-top)) var(--spacing-sm) calc(80px + env(safe-area-inset-bottom));
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 0.75rem;
        max-height: 50vh;
    }
    
    .modal-body .setting-group {
        margin-bottom: 0.875rem;
    }
    
    .modal-body .form-check-input {
        width: 2.4em;
        height: 1.4em;
        margin-left: 0.875rem;
    }
    
    .modal-body .form-check-label {
        font-size: 0.95rem;
        padding-top: 0.2rem;
    }
    
    .modal-body .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .modal-body .form-control {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    .modal-body textarea.form-control {
        min-height: 80px;
    }
    
    .developer-info {
        font-size: 0.95rem;
        padding: 0.6rem 0;
        margin-top: 0.6rem;
    }
    
    .developer-info a {
        font-size: 0.95rem;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    .modal-dialog {
        max-width: 95%;
        margin: 1rem auto;
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
        width: calc(100% - 2rem);
    }
    
    .modal-content {
        border-radius: 10px;
        max-height: 90vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.625rem;
    }
    
    .modal-title {
        font-size: 1rem;
    }
    
    .modal-close-btn {
        font-size: 1rem;
        padding: 0.35rem;
        left: 0.625rem;
        top: 0.625rem;
    }
    
    .modal-footer .btn {
        padding: 0.45rem;
        font-size: 0.9rem;
    }
    
    main#quran-container {
        padding: calc(55px + env(safe-area-inset-top)) var(--spacing-xs) calc(80px + env(safe-area-inset-bottom));
    }
    
    .app-header h1 {
        font-size: 1rem;
    }
    
    .athkar-text {
        font-size: 1.1rem;
        padding: 0 var(--spacing-sm);
    }
    
    .counter-btn {
        width: 50px;
        height: 50px;
    }
    
    .counter-value {
        font-size: 1.8rem;
    }
    
    .modal-title {
        font-size: 1.05rem;
    }
    
    .modal-body {
        padding: 0.625rem;
        max-height: 45vh;
    }
    
    .modal-body .setting-group {
        margin-bottom: 0.75rem;
    }
    
    .modal-body .form-check-input {
        width: 2.3em;
        height: 1.3em;
        margin-left: 0.75rem;
    }
    
    .modal-body .form-check-label {
        font-size: 0.9rem;
        padding-top: 0.15rem;
    }
    
    .modal-body .form-label {
        font-size: 0.85rem;
        margin-bottom: 0.35rem;
    }
    
    .modal-body .form-control {
        padding: 0.55rem;
        font-size: 0.85rem;
    }
    
    .modal-body textarea.form-control {
        min-height: 70px;
    }
    
    .developer-info {
        font-size: 0.9rem;
        padding: 0.55rem 0;
        margin-top: 0.55rem;
    }
    
    .developer-info a {
        font-size: 0.9rem;
    }
}

/* Very small devices (small phones, less than 400px) */
@media (max-width: 399.98px) {
    .modal-dialog {
        max-width: 97%;
        margin: 0.75rem auto;
        margin-top: 0.25rem;
        margin-bottom: 0.25rem;
        width: calc(100% - 1.5rem);
    }
    
    .modal-content {
        border-radius: 8px;
        max-height: 92vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.5rem;
    }
    
    .modal-title {
        font-size: 0.95rem;
    }
    
    .modal-close-btn {
        font-size: 0.95rem;
        padding: 0.3rem;
        left: 0.5rem;
        top: 0.5rem;
    }
    
    .modal-footer .btn {
        padding: 0.4rem;
        font-size: 0.85rem;
    }
    
    main#quran-container {
        padding: calc(50px + env(safe-area-inset-top)) var(--spacing-xs) calc(70px + env(safe-area-inset-bottom));
    }
    
    .app-header h1 {
        font-size: 0.95rem;
    }
    
    .athkar-text {
        font-size: 1rem;
    }
    
    .counter-btn {
        width: 45px;
        height: 45px;
    }
    
    .counter-value {
        font-size: 1.6rem;
    }
    
    .modal-title {
        font-size: 1rem;
    }
    
    .modal-body {
        padding: 0.5rem;
        max-height: 40vh;
    }
    
    .modal-body .setting-group {
        margin-bottom: 0.625rem;
    }
    
    .modal-body .form-check-input {
        width: 2.2em;
        height: 1.2em;
        margin-left: 0.625rem;
    }
    
    .modal-body .form-check-label {
        font-size: 0.85rem;
        padding-top: 0.1rem;
    }
    
    .modal-body .form-label {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
    
    .modal-body .form-control {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .modal-body textarea.form-control {
        min-height: 60px;
    }
    
    .developer-info {
        font-size: 0.85rem;
        padding: 0.5rem 0;
        margin-top: 0.5rem;
    }
    
    .developer-info a {
        font-size: 0.85rem;
    }
}

/* Extra small devices (very small phones, less than 320px) */
@media (max-width: 319.98px) {
    .modal-dialog {
        max-width: 98%;
        margin: 0.5rem auto;
        margin-top: 0.1rem;
        margin-bottom: 0.1rem;
        width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 6px;
        max-height: 94vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.4rem;
    }
    
    .modal-title {
        font-size: 0.9rem;
    }
    
    .modal-close-btn {
        font-size: 0.9rem;
        padding: 0.25rem;
        left: 0.4rem;
        top: 0.4rem;
    }
    
    .modal-footer .btn {
        padding: 0.35rem;
        font-size: 0.8rem;
    }
    
    main#quran-container {
        padding: calc(45px + env(safe-area-inset-top)) var(--spacing-xs) calc(65px + env(safe-area-inset-bottom));
    }
    
    .app-header h1 {
        font-size: 0.9rem;
    }
    
    .athkar-text {
        font-size: 0.95rem;
    }
    
    .counter-btn {
        width: 40px;
        height: 40px;
    }
    
    .counter-value {
        font-size: 1.5rem;
    }
    
    .modal-title {
        font-size: 0.95rem;
    }
    
    .modal-body {
        padding: 0.4rem;
        max-height: 35vh;
    }
    
    .modal-body .setting-group {
        margin-bottom: 0.5rem;
    }
    
    .modal-body .form-check-input {
        width: 2.1em;
        height: 1.1em;
        margin-left: 0.5rem;
    }
    
    .modal-body .form-check-label {
        font-size: 0.8rem;
        padding-top: 0.05rem;
    }
    
    .modal-body .form-label {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .modal-body .form-control {
        padding: 0.45rem;
        font-size: 0.75rem;
    }
    
    .modal-body textarea.form-control {
        min-height: 50px;
    }
    
    .developer-info {
        font-size: 0.8rem;
        padding: 0.45rem 0;
        margin-top: 0.45rem;
    }
    
    .developer-info a {
        font-size: 0.8rem;
    }
}

/* Tasbeeh Page Specific Styles */
.tasbeeh-title {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
}

.tasbeeh-counter .counter {
    margin: var(--spacing-xl) 0;
}

.tasbeeh-counter .counter-value {
    font-size: 3rem;
    min-width: 120px;
}

.tasbeeh-counter .counter-btn {
    width: 80px;
    height: 80px;
    font-size: 1.5rem;
}

.tasbeeh-counter .counter-btn i {
    font-size: 2rem;
}

.counter-controls {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.counter-controls .btn {
    min-width: 120px;
    padding: 0.5rem 1rem;
}

.tasbeeh-texts {
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-lg);
}

.tasbeeh-texts h3 {
    color: var(--primary-color);
    font-weight: 700;
}

.athkar-item {
    background-color: var(--card-background);
    transition: var(--transition);
}

.athkar-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* New Tasbeeh Design */
.tasbeeh-ring-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tasbeeh-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform: rotate(-90deg);
}

.bead {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: var(--border-color);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    margin: -10px;
    transition: background-color 0.3s ease;
}

.bead.active {
    background-color: var(--primary-color);
}

.total-counter {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 1rem;
}

.tasbeeh-container {
    display: flex;
    flex-direction: column;
}

.counter-display {
    font-size: 5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.counter-btn-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-lg);
    user-select: none;
}

/* PWA Installation Prompt */
.pwa-hint-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-background);
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    padding: var(--spacing-md);
    z-index: 1000;
    border-top: 1px solid var(--border-color);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.pwa-hint-container.visible {
    transform: translateY(0);
}

.pwa-hint-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.pwa-hint-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-color);
}

.pwa-hint-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

.pwa-hint-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.pwa-install-btn {
    background-color: var(--primary-color);
    color: white;
}

.pwa-install-btn:hover {
    background-color: var(--primary-dark);
}

.pwa-dismiss-btn {
    background-color: var(--border-color-light);
    color: var(--text-color);
}

.pwa-dismiss-btn:hover {
    background-color: var(--border-color);
}

/* Dark mode adjustments for PWA hint */
[data-theme="dark"] .pwa-hint-container {
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
}

/* Hide PWA hint on desktop */
@media (min-width: 768px) {
    .pwa-hint-container {
        display: none;
    }
}

.counter-btn-large {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.counter-btn-large:active {
    transform: scale(0.95);
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.4);
}

.control-btn {
    min-width: 120px;
    padding: 0.75rem 1rem;
    border-radius: 50px;
    font-weight: 500;
    min-height: 44px; /* Touch target size */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.athkar-section {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.athkar-section h3 {
    color: var(--primary-color);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.athkar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.athkar-card-item {
    background: var(--background-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    border: 1px solid var(--border-color-light);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 150px;
}

.athkar-card-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.athkar-text {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: var(--spacing-sm);
    text-align: center;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.athkar-count {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Dark mode adjustments for Tasbeeh page */
[data-theme="dark"] .athkar-item {
    background-color: #2a2a2a;
}

[data-theme="dark"] .athkar-card-item {
    background-color: #2a2a2a;
    border-color: var(--border-color);
}

/* Responsive adjustments for Tasbeeh page */
@media (max-width: 576px) {
    .tasbeeh-counter .counter-value {
        font-size: 2.5rem;
        min-width: 100px;
    }
    
    .tasbeeh-counter .counter-btn {
        width: 70px;
        height: 70px;
    }
    
    .counter-controls .btn {
        min-width: 100px;
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
        min-height: 40px;
    }
    
    .counter-display {
        font-size: 3.5rem;
    }
    
    .counter-btn-large {
        width: 120px;
        height: 120px;
        font-size: 1.2rem;
    }
    
    .control-btn {
        min-width: 100px;
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
        min-height: 40px;
    }
    
    .athkar-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .athkar-card-item {
        padding: var(--spacing-sm);
        min-height: 130px;
    }
    
    .athkar-text {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .athkar-count {
        font-size: 0.85rem;
        padding: 0.2rem 0.6rem;
    }
}

@media (max-width: 400px) {
    .tasbeeh-counter .counter-value {
        font-size: 2rem;
        min-width: 80px;
    }
    
    .tasbeeh-counter .counter-btn {
        width: 60px;
        height: 60px;
    }
    
    .counter-controls {
        gap: var(--spacing-sm);
    }
    
    .counter-controls .btn {
        min-width: 90px;
        padding: 0.3rem 0.6rem;
        font-size: 0.85rem;
        min-height: 38px;
    }
    
    .counter-display {
        font-size: 3rem;
    }
    
    .counter-btn-large {
        width: 100px;
        height: 100px;
    }
    
    .control-btn {
        min-width: 90px;
        padding: 0.5rem 0.7rem;
        font-size: 0.85rem;
        min-height: 38px;
    }
    
    .athkar-card-item {
        min-height: 120px;
    }
    
    .athkar-text {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

@media (max-width: 320px) {
    .tasbeeh-counter .counter-value {
        font-size: 1.8rem;
        min-width: 70px;
    }
    
    .tasbeeh-counter .counter-btn {
        width: 50px;
        height: 50px;
    }
    
    .counter-controls .btn {
        min-width: 80px;
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
        min-height: 36px;
    }
    
    .counter-display {
        font-size: 2.5rem;
    }
    
    .counter-btn-large {
        width: 90px;
        height: 90px;
    }
    
    .control-btn {
        min-width: 80px;
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        min-height: 36px;
    }
    
    .athkar-card-item {
        padding: var(--spacing-xs);
        min-height: 110px;
    }
    
    .athkar-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .athkar-count {
        font-size: 0.8rem;
        padding: 0.15rem 0.5rem;
    }
}

@media (min-width: 768px) {
    .athkar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .athkar-text {
        font-size: 1.15rem;
    }
}

@media (min-width: 992px) {
    .athkar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .athkar-text {
        font-size: 1.2rem;
    }
}

@media (min-width: 1200px) {
    .athkar-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .athkar-text {
        font-size: 1.25rem;
    }
}

@media (min-width: 1400px) {
    .athkar-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .athkar-text {
        font-size: 1.3rem;
    }
    
    .athkar-card-item {
        min-height: 180px;
    }
}

/* Touch Optimizations for Modals */
@media (hover: none) and (pointer: coarse) {
    .modal-close-btn {
        padding: 0.75rem;
        font-size: 1.3rem;
        min-height: 48px;
        min-width: 48px;
    }
    
    .modal-footer .btn {
        min-height: 48px;
        min-width: 48px;
        padding: 0.75rem 1.5rem;
    }
    
    .modal-body .form-check-input {
        min-height: 48px;
        min-width: 48px;
    }
    
    .modal-body .form-control {
        min-height: 48px;
        padding: 0.875rem;
    }
    
    .modal-body textarea.form-control {
        min-height: 120px;
    }
}

/* Ensure proper scrolling on mobile devices */
.modal-body {
    -webkit-overflow-scrolling: touch;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--background-color);
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

[data-theme="dark"] .modal-body::-webkit-scrollbar-track {
    background: #2c2c2c;
}

[data-theme="dark"] .modal-body::-webkit-scrollbar-thumb {
    background: #555;
}

[data-theme="dark"] .modal-body::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Modal Content Styles */
.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
    word-wrap: break-word;
    hyphens: auto;
}

.modal-body {
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-body .setting-group {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    min-height: 44px; /* Touch target size */
}

.modal-body .form-check-input {
    float: right;
    margin-left: 1rem;
    min-height: 24px;
    min-width: 24px;
}

.modal-body .form-check-label {
    padding-top: 0.25rem;
    display: block;
    margin-right: 0;
    flex: 1;
    min-height: 44px; /* Touch target size */
    display: flex;
    align-items: center;
}

.modal-body .form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    min-height: 44px; /* Touch target size */
    display: flex;
    align-items: center;
}

.modal-body .form-control {
    background-color: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 1rem;
    color: var(--text-color);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    min-height: 44px; /* Touch target size */
}

.modal-body .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(76, 175, 80, 0.25);
    outline: 0;
}

.modal-body .form-control:disabled,
.modal-body .form-control[readonly] {
    background-color: var(--background-color);
    opacity: 1;
}

.modal-body textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.developer-info {
    font-size: 1.1rem;
    color: var(--text-light);
    text-align: center;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-color-light);
    margin-top: 0.75rem;
    word-wrap: break-word;
    hyphens: auto;
    line-height: 1.6;
}

.developer-info a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.developer-info a:hover {
    text-decoration: underline;
}

/* Responsive Adjustments for Modal Content */
@media (max-width: 991.98px) {
    .modal-title {
        font-size: 1.15rem;
    }
    
    .modal-body {
        padding: 0.875rem;
        max-height: 55vh;
    }
    
    .modal-body .form-check-input {
        width: 2.5em;
        height: 1.5em;
    }
    
    .modal-body .form-label {
        font-size: 0.95rem;
    }
    
    .modal-body .form-control {
        padding: 0.65rem;
        font-size: 0.95rem;
    }
    
    .developer-info {
        font-size: 1rem;
        padding: 0.65rem 0;
        margin-top: 0.65rem;
    }
    
    .developer-info a {
        font-size: 1rem;
    }
}

@media (max-width: 767.98px) {
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 0.75rem;
        max-height: 50vh;
    }
    
    .modal-body .setting-group {
        margin-bottom: 0.875rem;
    }
    
    .modal-body .form-check-input {
        width: 2.4em;
        height: 1.4em;
        margin-left: 0.875rem;
    }
    
    .modal-body .form-check-label {
        font-size: 0.95rem;
        padding-top: 0.2rem;
    }
    
    .modal-body .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .modal-body .form-control {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    .modal-body textarea.form-control {
        min-height: 80px;
    }
    
    .developer-info {
        font-size: 0.95rem;
        padding: 0.6rem 0;
        margin-top: 0.6rem;
    }
    
    .developer-info a {
        font-size: 0.95rem;
    }
}

@media (max-width: 575.98px) {
    .modal-title {
        font-size: 1.05rem;
    }
    
    .modal-body {
        padding: 0.625rem;
        max-height: 45vh;
    }
    
    .modal-body .setting-group {
        margin-bottom: 0.75rem;
    }
    
    .modal-body .form-check-input {
        width: 2.3em;
        height: 1.3em;
        margin-left: 0.75rem;
    }
    
    .modal-body .form-check-label {
        font-size: 0.9rem;
        padding-top: 0.15rem;
    }
    
    .modal-body .form-label {
        font-size: 0.85rem;
        margin-bottom: 0.35rem;
    }
    
    .modal-body .form-control {
        padding: 0.55rem;
        font-size: 0.85rem;
    }
    
    .modal-body textarea.form-control {
        min-height: 70px;
    }
    
    .developer-info {
        font-size: 0.9rem;
        padding: 0.55rem 0;
        margin-top: 0.55rem;
    }
    
    .developer-info a {
        font-size: 0.9rem;
    }
}

@media (max-width: 399.98px) {
    .modal-title {
        font-size: 1rem;
    }
    
    .modal-body {
        padding: 0.5rem;
        max-height: 40vh;
    }
    
    .modal-body .setting-group {
        margin-bottom: 0.625rem;
    }
    
    .modal-body .form-check-input {
        width: 2.2em;
        height: 1.2em;
        margin-left: 0.625rem;
    }
    
    .modal-body .form-check-label {
        font-size: 0.85rem;
        padding-top: 0.1rem;
    }
    
    .modal-body .form-label {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
    
    .modal-body .form-control {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .modal-body textarea.form-control {
        min-height: 60px;
    }
    
    .developer-info {
        font-size: 0.85rem;
        padding: 0.5rem 0;
        margin-top: 0.5rem;
    }
    
    .developer-info a {
        font-size: 0.85rem;
    }
}

@media (max-width: 319.98px) {
    .modal-title {
        font-size: 0.95rem;
    }
    
    .modal-body {
        padding: 0.4rem;
        max-height: 35vh;
    }
    
    .modal-body .setting-group {
        margin-bottom: 0.5rem;
    }
    
    .modal-body .form-check-input {
        width: 2.1em;
        height: 1.1em;
        margin-left: 0.5rem;
    }
    
    .modal-body .form-check-label {
        font-size: 0.8rem;
    }
    
    .modal-body .form-label {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .modal-body .form-control {
        padding: 0.45rem;
        font-size: 0.75rem;
    }
    
    .modal-body textarea.form-control {
        min-height: 50px;
    }
    
    .developer-info {
        font-size: 0.8rem;
        padding: 0.45rem 0;
        margin-top: 0.45rem;
    }
    
    .developer-info a {
        font-size: 0.8rem;
    }
}

/* Navigation Styles */
#main-nav-pills {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

#main-nav-pills .nav-item {
    flex: 1;
    text-align: center;
    margin: 0;
    padding: 0;
    min-width: 80px;
}

#main-nav-pills .nav-link {
    color: var(--text-light);
    padding: 12px 0;
    border-radius: 0;
    border: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    position: relative;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

#main-nav-pills .nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(76, 175, 80, 0.1);
}

#main-nav-pills .nav-link.active,
#main-nav-pills .nav-link:active,
#main-nav-pills .nav-link.active-state {
    color: white;
    background-color: var(--primary-color);
}

#main-nav-pills .nav-link i {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.nav-text {
    display: block;
    font-size: 0.75rem;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    padding: 0 2px;
}

/* Improved responsive navigation for all screen sizes */
.nav-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--card-background);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding: 0;
    border-top: 1px solid var(--border-color);
}

[data-theme="dark"] .nav-container {
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--border-color);
}

/* Touch Optimizations */
.touch-optimized {
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.touch-target {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .app-header {
        padding: 0.4rem 0;
        min-height: 42px;
    }
    
    .app-header h1 {
        font-size: 1.05rem;
    }
    
    .settings-toggle, .btn-outline-light {
        width: 38px;
        height: 38px;
        min-height: 38px;
        min-width: 38px;
    }
    
    .settings-toggle i, .btn-outline-light i {
        font-size: 1.1rem;
    }
    
    main#athkar-display, main#quran-container {
        padding: calc(55px + env(safe-area-inset-top)) var(--spacing-md) calc(75px + env(safe-area-inset-bottom));
    }
    
    .athkar-text {
        font-size: 1.4rem;
    }
    
    .athkar-reference {
        font-size: 1rem;
    }
    
    .athkar-fadl {
        font-size: 1.05rem;
    }
    
    .counter-btn {
        width: 55px;
        height: 55px;
        min-height: 44px;
        min-width: 44px;
    }
    
    #main-nav-pills .nav-item {
        min-width: 70px;
    }
    
    #main-nav-pills .nav-link {
        font-size: 0.8rem;
        padding: 10px 0;
        min-height: 55px;
    }
    
    #main-nav-pills .nav-link i {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 0.35rem 0;
        min-height: 40px;
    }
    
    .app-header h1 {
        font-size: 1rem;
    }
    
    .app-header p {
        font-size: 0.7rem;
    }
    
    .settings-toggle, .btn-outline-light {
        width: 36px;
        height: 36px;
        min-height: 36px;
        min-width: 36px;
    }
    
    .settings-toggle i, .btn-outline-light i {
        font-size: 1.05rem;
    }
    
    main#athkar-display, main#quran-container {
        padding: calc(52px + env(safe-area-inset-top)) var(--spacing-sm) calc(70px + env(safe-area-inset-bottom));
    }
    
    .athkar-text {
        font-size: 1.3rem;
        padding: 0 var(--spacing-sm);
    }
    
    .athkar-reference {
        font-size: 0.95rem;
    }
    
    .athkar-fadl {
        font-size: 1rem;
    }
    
    .counter-btn {
        width: 50px;
        height: 50px;
    }
    
    .counter-value {
        font-size: 1.8rem;
    }
    
    #main-nav-pills .nav-item {
        min-width: 60px;
    }
    
    #main-nav-pills .nav-link {
        font-size: 0.75rem;
        padding: 8px 0;
        min-height: 50px;
    }
    
    #main-nav-pills .nav-link i {
        font-size: 1rem;
        margin-bottom: 3px;
    }
}

@media (max-width: 576px) {
    .app-header {
        min-height: 38px;
        padding: 0.3rem 0;
    }
    
    .app-header h1 {
        font-size: 0.95rem;
    }
    
    .app-header p {
        font-size: 0.65rem;
    }
    
    .settings-toggle, .btn-outline-light {
        width: 34px;
        height: 34px;
        min-height: 34px;
        min-width: 34px;
    }
    
    .settings-toggle i, .btn-outline-light i {
        font-size: 1rem;
    }
    
    main#athkar-display, main#quran-container {
        padding: calc(50px + env(safe-area-inset-top)) var(--spacing-sm) calc(65px + env(safe-area-inset-bottom));
    }
    
    .athkar-text {
        font-size: 1.2rem;
    }
    
    .athkar-reference {
        font-size: 0.9rem;
    }
    
    .athkar-fadl {
        font-size: 0.95rem;
    }
    
    .counter-btn {
        width: 45px;
        height: 45px;
    }
    
    .counter-value {
        font-size: 1.6rem;
    }
    
    #main-nav-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
    }
    
    #main-nav-pills::-webkit-scrollbar {
        display: none;
    }
    
    #main-nav-pills .nav-item {
        flex: 0 0 auto;
        min-width: 70px;
        padding: 0 2px;
    }
    
    #main-nav-pills .nav-link {
        font-size: 0.7rem;
        padding: 6px 0;
        min-height: 45px;
        border-radius: 8px;
        margin: 5px 2px;
    }
    
    #main-nav-pills .nav-link i {
        font-size: 0.9rem;
        margin-bottom: 2px;
    }
}

@media (max-width: 400px) {
    .app-header {
        min-height: 36px;
        padding: 0.25rem 0;
    }
    
    .app-header h1 {
        font-size: 0.9rem;
    }
    
    .app-header p {
        font-size: 0.6rem;
    }
    
    .settings-toggle, .btn-outline-light {
        width: 32px;
        height: 32px;
        min-height: 32px;
        min-width: 32px;
    }
    
    .settings-toggle i, .btn-outline-light i {
        font-size: 0.95rem;
    }
    
    .athkar-text {
        font-size: 1.1rem;
    }
    
    .athkar-reference {
        font-size: 0.85rem;
    }
    
    .athkar-fadl {
        font-size: 0.9rem;
    }
    
    .counter-btn {
        width: 40px;
        height: 40px;
    }
    
    .counter-value {
        font-size: 1.5rem;
    }
    
    main#athkar-display, main#quran-container {
        padding: calc(48px + env(safe-area-inset-top)) var(--spacing-xs) calc(60px + env(safe-area-inset-bottom));
    }
    
    #main-nav-pills .nav-item {
        min-width: 60px;
    }
    
    #main-nav-pills .nav-link {
        font-size: 0.65rem;
        min-height: 42px;
    }
    
    #main-nav-pills .nav-link i {
        font-size: 0.85rem;
    }
}

/* Extra small devices */
@media (max-width: 320px) {
    .app-header {
        min-height: 34px;
        padding: 0.2rem 0;
    }
    
    .app-header h1 {
        font-size: 0.85rem;
    }
    
    .app-header p {
        font-size: 0.55rem;
    }
    
    .settings-toggle, .btn-outline-light {
        width: 30px;
        height: 30px;
        min-height: 30px;
        min-width: 30px;
    }
    
    .settings-toggle i, .btn-outline-light i {
        font-size: 0.9rem;
    }
    
    .athkar-text {
        font-size: 1rem;
    }
    
    .athkar-reference {
        font-size: 0.8rem;
    }
    
    .athkar-fadl {
        font-size: 0.85rem;
    }
    
    .counter-btn {
        width: 38px;
        height: 38px;
    }
    
    .counter-value {
        font-size: 1.4rem;
    }
    
    main#athkar-display, main#quran-container {
        padding: calc(46px + env(safe-area-inset-top)) var(--spacing-xs) calc(58px + env(safe-area-inset-bottom));
    }
    
    #main-nav-pills .nav-item {
        min-width: 55px;
    }
    
    #main-nav-pills .nav-link {
        font-size: 0.6rem;
        min-height: 40px;
        padding: 5px 0;
    }
    
    #main-nav-pills .nav-link i {
        font-size: 0.8rem;
    }
}

/* PWA Installation Hint */
.pwa-hint-container {
    position: fixed;
    bottom: 65px;
    left: 0;
    right: 0;
    background-color: var(--card-background);
    padding: 8px 12px;
    text-align: center;
    z-index: 99;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
    display: none;
}

.pwa-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.pwa-hint i {
    color: var(--primary-color);
}

.pwa-hint-text {
    line-height: 1.4;
}

/* Show hint only on mobile devices */
@media (max-width: 768px) {
    .pwa-hint-container {
        display: block;
    }
}

/* Dark mode adjustments for PWA hint */
[data-theme="dark"] .pwa-hint-container {
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
}
