/* ============================================================
   AtwsQuran Official - Responsive Styles
   Mobile-first responsive design for all devices
   ============================================================ */

/* ===== EXTRA LARGE DEVICES (1400px and up) ===== */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    .hero-section h1 {
        font-size: 4rem;
    }

    .hero-title-arabic {
        font-size: 4rem;
    }

    .arabic-heading {
        font-size: 4.2rem;
    }

    .arabic-sub {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2.8rem;
    }

    .stat-number {
        font-size: 3.2rem;
    }
}

/* ===== LARGE DEVICES (1200px to 1399px) ===== */
@media (min-width: 1200px) and (max-width: 1399px) {
    .hero-section h1 {
        font-size: 3.5rem;
    }

    .hero-title-arabic {
        font-size: 3.5rem;
    }

    .arabic-heading {
        font-size: 3.8rem;
    }

    .arabic-sub {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .course-card-image {
        height: 200px;
    }

    .teacher-image {
        height: 230px;
    }
}

/* ===== MEDIUM-LARGE DEVICES (992px to 1199px) ===== */
@media (min-width: 992px) and (max-width: 1199px) {
    .hero-section {
        padding: 100px 0 60px;
    }

    .hero-section h1 {
        font-size: 3rem;
    }

    .hero-title-arabic {
        font-size: 3rem;
    }

    .arabic-heading {
        font-size: 3.2rem;
    }

    .arabic-sub {
        font-size: 1.8rem;
    }

    .hero-subheading {
        font-size: 1.3rem;
    }

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

    .hero-section .tagline {
        font-size: 1.15rem;
    }

    .section-title {
        font-size: 2.2rem;
    }

    .navbar-brand {
        font-size: 1.4rem;
    }

    .nav-link {
        font-size: 0.85rem;
        padding: 8px 10px !important;
    }

    .course-card-image {
        height: 180px;
    }

    .teacher-image {
        height: 200px;
    }

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

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

/* ===== TABLET LANDSCAPE / SMALL LAPTOP (768px to 991px) ===== */
@media (max-width: 991px) {
    .hero-section {
        padding: 80px 0 50px;
        min-height: auto;
    }

    .hero-section h1 {
        font-size: 2.8rem;
    }

    .hero-title-arabic {
        font-size: 2.5rem;
    }

    .arabic-heading {
        font-size: 2.8rem;
    }

    .arabic-sub {
        font-size: 1.5rem;
    }

    .hero-subheading {
        font-size: 1.2rem;
    }

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

    .trust-badge {
        font-size: 0.85rem;
        padding: 4px 10px;
    }

    .hero-section .tagline {
        font-size: 1.1rem;
    }

    .navbar-brand {
        font-size: 1.3rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 35px;
    }

    .section {
        padding: 60px 0;
    }

    /* Mobile nav adjustments */
    .navbar-collapse {
        background: linear-gradient(135deg, #0a3d1a 0%, #1a5d2a 100%);
        padding: 15px;
        border-radius: 12px;
        margin-top: 10px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }

    .navbar-nav .nav-link {
        padding: 10px 15px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .navbar-nav .nav-link::after {
        display: none;
    }

    .navbar-nav .nav-item:last-child .nav-link {
        border-bottom: none;
    }

    .navbar .btn-warning {
        margin: 10px 0 0 0 !important;
        width: 100%;
        text-align: center;
    }

    .navbar-nav .dropdown-menu {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        margin: 0 0 10px 0;
    }

    .dropdown-item {
        color: rgba(255, 255, 255, 0.8) !important;
    }

    .dropdown-item:hover {
        background: rgba(255, 193, 7, 0.1) !important;
        color: #ffc107 !important;
    }

    .dashboard-sidebar {
        position: relative;
        min-height: auto;
        border-radius: 12px;
        margin-bottom: 20px;
    }

    .sidebar-menu {
        display: flex;
        flex-wrap: wrap;
    }

    .sidebar-menu a {
        flex: 1 1 45%;
        padding: 12px 15px;
        font-size: 0.9rem;
        border-left: none;
        border-bottom: 2px solid transparent;
        text-align: center;
    }

    .sidebar-menu a:hover,
    .sidebar-menu a.active {
        border-bottom-color: var(--accent-gold);
        border-left: none;
        padding-left: 15px;
    }

    /* New sections responsiveness */
    .teach-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .trust-badges-grid {
        gap: 12px 20px;
    }

    .trust-badge-item {
        font-size: 0.9rem;
        padding: 8px 16px;
    }

    /* Footer */
    .footer-widget {
        margin-bottom: 10px;
    }

    .footer-top {
        padding: 40px 0 20px;
    }
}

/* ===== TABLET PORTRAIT (576px to 767px) ===== */
@media (max-width: 767px) {
    .hero-section {
        padding: 60px 0 40px;
    }

    .hero-section h1 {
        font-size: 2.2rem;
        line-height: 1.3;
    }

    .hero-title-arabic {
        font-size: 2rem;
    }

    .arabic-heading {
        font-size: 2.2rem;
    }

    .arabic-sub {
        font-size: 1.3rem;
    }

    .hero-subheading {
        font-size: 1.1rem;
    }

    .hero-description {
        font-size: 0.9rem;
        max-width: 100%;
    }

    .trust-badges {
        gap: 8px 12px;
    }

    .trust-badge {
        font-size: 0.8rem;
        padding: 4px 10px;
    }

    .hero-section .tagline {
        font-size: 1rem;
    }

    .hero-section .btn {
        padding: 12px 25px;
        font-size: 0.95rem;
        width: 100%;
    }

    .hero-section .d-flex {
        flex-direction: column;
        align-items: center;
        gap: 12px !important;
    }

    .section {
        padding: 45px 0;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .section-subtitle {
        font-size: 0.95rem;
        margin-bottom: 30px;
    }

    .course-card {
        margin-bottom: 20px;
    }

    .course-card-image {
        height: 180px;
        font-size: 2.5rem;
    }

    .course-card-body {
        padding: 20px;
    }

    .course-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .course-duration {
        font-size: 0.85rem;
    }

    .course-level {
        font-size: 0.8rem;
        padding: 4px 12px;
    }

    .teacher-card {
        margin-bottom: 20px;
    }

    .teacher-image {
        height: 200px;
        font-size: 3rem;
    }

    .teacher-info {
        padding: 20px;
    }

    .teacher-info h5 {
        font-size: 1.1rem;
    }

    .table {
        font-size: 0.85rem;
    }

    .table td,
    .table th {
        padding: 8px 5px;
    }

    .stat-card {
        margin-bottom: 15px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-icon {
        font-size: 2rem;
    }

    .page-header {
        padding: 60px 0 35px;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .cta-section {
        padding: 50px 0;
    }

    .cta-section h2 {
        font-size: 1.6rem;
    }

    .cta-section .lead {
        font-size: 1rem;
    }

    .footer-top {
        padding: 35px 0 15px;
    }

    .footer-widget-title {
        margin-bottom: 15px;
    }

    .footer-widget {
        margin-bottom: 25px;
    }

    .social-links {
        gap: 8px;
    }

    .social-icon img {
        width: 32px;
        height: 32px;
    }

    .teach-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .teach-card {
        padding: 25px 20px;
    }

    .teach-icon {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }

    .teach-card h5 {
        font-size: 1.05rem;
    }

    .teach-card p {
        font-size: 0.85rem;
    }

    .courses-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .trust-badges-grid {
        gap: 10px 15px;
    }

    .trust-badge-item {
        font-size: 0.85rem;
        padding: 6px 14px;
    }
}

/* ===== MOBILE (575px and below) ===== */
@media (max-width: 575px) {
    body {
        font-size: 0.9rem;
    }

    .hero-section {
        padding: 50px 0 35px;
    }

    .hero-section h1 {
        font-size: 1.6rem;
    }

    .hero-title-arabic {
        font-size: 1.5rem;
    }

    .arabic-heading {
        font-size: 1.8rem;
    }

    .arabic-sub {
        font-size: 1.1rem;
    }

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

    .hero-description {
        font-size: 0.85rem;
        max-width: 100%;
    }

    .trust-badges {
        gap: 6px 8px;
    }

    .trust-badge {
        font-size: 0.75rem;
        padding: 3px 8px;
        white-space: normal;
    }

    .hero-section .tagline {
        font-size: 0.85rem;
    }

    .hero-section .btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .navbar-brand img {
        width: 28px !important;
        height: 28px !important;
    }

    .section {
        padding: 35px 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-title::after {
        width: 60px;
        height: 3px;
    }

    .section-subtitle {
        font-size: 0.9rem;
        margin-bottom: 25px;
    }

    .course-card {
        margin-bottom: 15px;
    }

    .course-card-image {
        height: 150px;
        font-size: 2.2rem;
    }

    .course-card-body {
        padding: 15px;
    }

    .course-card h5 {
        font-size: 1rem;
    }

    .course-card p {
        font-size: 0.85rem;
    }

    .course-meta {
        flex-direction: column;
        gap: 8px;
    }

    .course-duration {
        font-size: 0.8rem;
    }

    .course-level {
        font-size: 0.75rem;
        padding: 4px 10px;
    }

    .teacher-card {
        margin-bottom: 15px;
    }

    .teacher-image {
        height: 180px;
        font-size: 2.5rem;
    }

    .teacher-info {
        padding: 15px;
    }

    .teacher-info h5 {
        font-size: 0.95rem;
    }

    .teacher-specialization {
        font-size: 0.8rem;
    }

    .teacher-experience {
        font-size: 0.85rem;
    }

    .testimonial-card {
        padding: 20px;
    }

    .testimonial-text {
        font-size: 0.85rem;
    }

    .testimonial-author {
        font-size: 0.85rem;
    }

    .form-control {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    .btn-gold {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    .btn-outline-gold {
        padding: 8px 18px;
        font-size: 0.85rem;
    }

    .table {
        font-size: 0.75rem;
    }

    .table td,
    .table th {
        padding: 6px 4px;
    }

    .table thead th {
        font-size: 0.7rem;
    }

    .stat-card {
        padding: 15px;
        margin-bottom: 12px;
    }

    .stat-number {
        font-size: 1.6rem;
    }

    .stat-icon {
        font-size: 1.6rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .page-header {
        padding: 50px 0 30px;
    }

    .page-header h1 {
        font-size: 1.6rem;
    }

    .page-header p {
        font-size: 0.9rem;
    }

    .cta-section {
        padding: 40px 0;
    }

    .cta-section h2 {
        font-size: 1.3rem;
    }

    .cta-section .lead {
        font-size: 0.9rem;
    }

    /* Form spacing */
    .form-label {
        font-size: 0.85rem;
    }

    /* Modal adjustments */
    .modal-content {
        border-radius: 10px;
    }

    .modal-header {
        background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
        color: white;
    }

    .modal-title {
        font-size: 1rem;
    }

    /* Footer adjustments */
    .site-footer {
        text-align: center;
    }

    .footer-widget-title {
        text-align: center;
    }

    .footer-widget-title::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-contact li {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

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

    .footer-bottom {
        text-align: center !important;
    }

    .footer-bottom .text-md-end {
        text-align: center !important;
        margin-top: 10px;
    }

    .social-links {
        justify-content: center;
        gap: 6px;
    }

    .social-icon img {
        width: 28px !important;
        height: 28px !important;
    }

    /* List adjustments */
    ul li {
        margin-bottom: 8px;
    }

    /* Padding and margins */
    .mb-4 {
        margin-bottom: 1.2rem !important;
    }

    .pt-5,
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    /* Back to top button */
    #back-to-top {
        width: 40px !important;
        height: 40px !important;
        bottom: 20px !important;
        right: 20px !important;
        font-size: 1rem !important;
    }

    /* Dashboard */
    .dashboard-sidebar .sidebar-menu a {
        flex: 1 1 100%;
        font-size: 0.85rem;
        padding: 10px;
    }

    /* Card grid spacing */
    .row > div {
        margin-bottom: 12px;
    }

    /* New sections mobile */
    .teach-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .teach-card {
        padding: 25px 20px;
    }

    .teach-icon {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }

    .teach-card h5 {
        font-size: 1.1rem;
    }

    .teach-card p {
        font-size: 0.85rem;
    }

    .courses-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .course-item-card {
        padding: 25px 20px;
    }

    .course-item-icon {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }

    .course-item-card h5 {
        font-size: 1.05rem;
    }

    .course-item-card p {
        font-size: 0.85rem;
    }

    .trust-badges-grid {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .trust-badge-item {
        font-size: 0.8rem;
        padding: 6px 14px;
        width: 100%;
        justify-content: center;
    }

    .section-dark {
        padding: 35px 0;
    }
}

/* ===== LANDSCAPE MODE (mobile) ===== */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-section {
        padding: 40px 0 30px;
        min-height: auto;
    }

    .hero-section h1 {
        font-size: 1.5rem;
    }

    .hero-title-arabic {
        font-size: 1.4rem;
    }

    .arabic-heading {
        font-size: 1.6rem;
    }

    .arabic-sub {
        font-size: 1rem;
    }

    .hero-subheading {
        font-size: 0.95rem;
    }

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

    .trust-badges {
        gap: 4px 8px;
    }

    .trust-badge {
        font-size: 0.7rem;
        padding: 2px 8px;
    }

    .section {
        padding: 30px 0;
    }

    .navbar-collapse {
        max-height: 80vh;
        overflow-y: auto;
    }

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

/* ===== PRINT STYLES ===== */
@media print {
    body {
        font-size: 12pt;
        color: #000 !important;
        background: #fff !important;
    }

    .navbar,
    .site-footer,
    .btn,
    .btn-gold,
    .btn-outline-gold,
    #back-to-top,
    .preloader {
        display: none !important;
    }

    .page-break {
        page-break-after: always;
    }

    /* Certificate printing */
    .certificate {
        page-break-inside: avoid;
        border: none;
        box-shadow: none;
    }

    .section {
        padding: 20px 0 !important;
    }

    .hero-section {
        padding: 30px 0 !important;
        background: #0a3d1a !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    .course-card,
    .teacher-card,
    .testimonial-card,
    .stat-card {
        transform: none !important;
    }

    .course-card:hover,
    .teacher-card:hover,
    .testimonial-card:hover,
    .stat-card:hover {
        transform: translateY(-5px) !important;
    }

    button,
    a.btn {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* ===== HIGH DPI / RETINA DISPLAYS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .section-title::after,
    .border-accent {
        border-width: 2px;
    }

    .hero-section {
        background: linear-gradient(135deg, rgba(10, 61, 26, 0.98) 0%, rgba(26, 93, 42, 0.96) 100%);
    }
}

/* ===== DARK MODE PREFERENCE ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #f0f0f0;
        --text-light: #c0c0c0;
        --bg-light: #1a1a1a;
        --border-color: #444;
        --bg-card: #1e1e1e;
    }

    body {
        background-color: #0d0d0d;
        color: #e8e8e8;
    }

    .bg-light-green {
        background-color: rgba(10, 61, 26, 0.2);
    }

    .card,
    .course-card,
    .teacher-card,
    .stat-card {
        background-color: #1e1e1e;
        border: 1px solid #333;
    }

    .card-body {
        color: #e8e8e8;
    }

    .card-body p,
    .card-body .text-muted {
        color: #b8c7b8 !important;
    }

    .course-card-body {
        background-color: #1e1e1e;
    }

    .course-card-body p {
        color: #b0b0b0;
    }

    .teacher-card {
        background-color: #1e1e1e;
    }

    .teacher-info p {
        color: #c0c0c0;
    }

    .teacher-experience {
        color: #b0b0b0;
    }

    .testimonial-card {
        background-color: #1e1e1e;
        border-left-color: var(--accent-gold);
    }

    .testimonial-text {
        color: #d0d0d0;
    }

    .stat-card {
        background-color: #1e1e1e;
    }

    .stat-label {
        color: #b0b0b0;
    }

    .form-control {
        background-color: #2a2a2a !important;
        color: #f0f0f0 !important;
        border-color: #555;
    }

    .form-control:focus {
        background-color: #333 !important;
        color: #ffffff !important;
        border-color: var(--accent-gold);
        box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.15);
    }

    .form-control::placeholder {
        color: #a0a0a0 !important;
    }

    .form-label {
        color: #e0e0e0 !important;
    }

    .table {
        color: #e0e0e0;
    }

    .table tbody tr:hover {
        background-color: rgba(255, 193, 7, 0.1);
    }

    /* New sections dark mode */
    .course-item-card {
        background-color: #1e1e1e;
        border: 1px solid #333;
    }

    .course-item-card h5 {
        color: #e8e8e8;
    }

    .course-item-card p {
        color: #c0c0c0;
    }

    .members-only-badge {
        background: linear-gradient(135deg, #1a5d2a, #2d7f3d);
    }

    .restricted-card .btn {
        background: #1e1e1e;
    }
}
