/* RSK World Theme - Responsive Design */
/* Created by: Molla Samser | Designer & Tester: Rima Khatun */

/* ===== Large Tablets (1024px and below) ===== */
@media (max-width: 1024px) {
    .container {
        padding: 0 var(--spacing-lg);
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
        text-align: center;
    }
    
    .hero-title {
        font-size: var(--text-4xl);
    }
    
    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }
    
    .about-text {
        order: 2;
    }
    
    .about-image {
        order: 1;
        text-align: center;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-2xl);
    }
}

/* ===== Tablets (768px and below) ===== */
@media (max-width: 768px) {
    :root {
        --text-6xl: 2.5rem;
        --text-5xl: 2rem;
        --text-4xl: 1.75rem;
        --text-3xl: 1.5rem;
        --text-2xl: 1.25rem;
        --text-xl: 1.125rem;
    }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    /* Theme Showcase */
    .theme-showcase {
        padding: 60px 0;
    }
    
    .theme-screenshot {
        margin: 0 -20px;
        border-radius: 0;
    }
    
    .theme-overlay {
        padding: 20px 15px 15px;
    }
    
    .theme-overlay h3 {
        font-size: 1.2rem;
    }
    
    .theme-badges {
        gap: 6px;
    }
    
    .theme-badges .badge {
        font-size: 0.7rem;
        padding: 3px 10px;
    }
    
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--bg-primary);
        box-shadow: var(--shadow-xl);
        transition: right var(--transition-normal);
        z-index: 999;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-list {
        flex-direction: column;
        padding: var(--spacing-2xl);
        gap: var(--spacing-lg);
    }
    
    .nav-link {
        font-size: var(--text-lg);
        padding: var(--spacing-md);
    }
    
    .nav-toggle {
        display: flex;
        z-index: 1001;
    }
    
    .nav-toggle.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Hero Section */
    .hero {
        min-height: auto;
        padding: var(--spacing-2xl) 0;
    }
    
    .hero-title {
        font-size: var(--text-3xl);
    }
    
    .hero-subtitle {
        font-size: var(--text-lg);
    }
    
    .hero-description {
        font-size: var(--text-base);
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    /* Sections */
    section {
        padding: var(--spacing-2xl) 0;
    }
    
    .section-title {
        font-size: var(--text-3xl);
    }
    
    .section-subtitle {
        font-size: var(--text-base);
    }
    
    /* Features Grid */
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: var(--spacing-lg);
    }
    
    .feature-card {
        padding: var(--spacing-xl);
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: var(--text-xl);
    }
    
    /* Courses Grid */
    .courses-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .course-image {
        height: 180px;
    }
    
    .course-content {
        padding: var(--spacing-lg);
    }
    
    /* Resources Grid */
    .resources-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--spacing-lg);
    }
    
    .resource-card {
        padding: var(--spacing-lg);
    }
    
    .resource-icon {
        width: 60px;
        height: 60px;
        font-size: var(--text-lg);
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    .stat-number {
        font-size: var(--text-3xl);
    }
    
    /* Team Info */
    .team-info {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        text-align: center;
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    /* Back to Top */
    .back-to-top {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
        width: 45px;
        height: 45px;
    }
}

/* ===== Mobile Phones (480px and below) ===== */
@media (max-width: 480px) {
    :root {
        --text-6xl: 2rem;
        --text-5xl: 1.75rem;
        --text-4xl: 1.5rem;
        --text-3xl: 1.25rem;
        --text-2xl: 1.125rem;
        --text-xl: 1rem;
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    /* Navigation */
    .nav-menu {
        width: 90%;
    }
    
    .nav-brand .logo {
        font-size: var(--text-lg);
    }
    
    .nav-brand .logo img {
        width: 30px;
        height: 30px;
    }
    
    /* Hero Section */
    .hero {
        padding: var(--spacing-lg) 0;
    }
    
    .hero-title {
        font-size: var(--text-2xl);
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: var(--text-base);
    }
    
    .hero-description {
        font-size: var(--text-sm);
    }
    
    .hero-buttons {
        gap: var(--spacing-sm);
    }
    
    .btn {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: var(--text-sm);
    }
    
    /* Code Editor */
    .code-editor {
        transform: none;
    }
    
    .editor-content pre {
        font-size: var(--text-xs);
    }
    
    /* Sections */
    section {
        padding: var(--spacing-lg) 0;
    }
    
    .section-title {
        font-size: var(--text-2xl);
    }
    
    .section-subtitle {
        font-size: var(--text-sm);
    }
    
    /* Feature Cards */
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .feature-card {
        padding: var(--spacing-lg);
    }
    
    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: var(--text-lg);
    }
    
    .feature-title {
        font-size: var(--text-lg);
    }
    
    .feature-description {
        font-size: var(--text-sm);
    }
    
    /* Course Cards */
    .course-image {
        height: 150px;
    }
    
    .course-content {
        padding: var(--spacing-md);
    }
    
    .course-title {
        font-size: var(--text-lg);
    }
    
    .course-description {
        font-size: var(--text-sm);
    }
    
    .course-meta {
        font-size: var(--text-xs);
        gap: var(--spacing-md);
    }
    
    .course-price {
        font-size: var(--text-lg);
    }
    
    /* Resource Cards */
    .resources-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .resource-card {
        padding: var(--spacing-md);
    }
    
    .resource-icon {
        width: 50px;
        height: 50px;
        font-size: var(--text-base);
    }
    
    .resource-title {
        font-size: var(--text-base);
    }
    
    .resource-description {
        font-size: var(--text-sm);
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .stat-number {
        font-size: var(--text-2xl);
    }
    
    .stat-label {
        font-size: var(--text-base);
    }
    
    /* About Section */
    .about-text h3 {
        font-size: var(--text-lg);
    }
    
    .team-member h4 {
        font-size: var(--text-base);
    }
    
    .role {
        font-size: var(--text-sm);
    }
    
    /* Contact Section */
    .contact-item {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
    
    .contact-icon {
        margin: 0 auto;
    }
    
    .contact-form {
        padding: var(--spacing-lg);
    }
    
    .form-group input,
    .form-group textarea {
        padding: var(--spacing-sm);
        font-size: var(--text-sm);
    }
    
    /* Footer */
    .footer {
        padding: var(--spacing-2xl) 0 var(--spacing-md);
    }
    
    .footer-logo img {
        width: 30px;
        height: 30px;
    }
    
    .footer-logo h3 {
        font-size: var(--text-lg);
    }
    
    .footer-title {
        font-size: var(--text-base);
    }
    
    .footer-links a {
        font-size: var(--text-sm);
    }
    
    .social-link {
        width: 35px;
        height: 35px;
        font-size: var(--text-sm);
    }
    
    .newsletter-form input {
        padding: var(--spacing-sm);
        font-size: var(--text-sm);
    }
    
    .footer-bottom {
        font-size: var(--text-xs);
    }
    
    /* Back to Top */
    .back-to-top {
        bottom: var(--spacing-sm);
        right: var(--spacing-sm);
        width: 40px;
        height: 40px;
        font-size: var(--text-sm);
    }
}

/* ===== Small Mobile Phones (320px and below) ===== */
@media (max-width: 320px) {
    .container {
        padding: 0 var(--spacing-xs);
    }
    
    .hero-title {
        font-size: var(--text-xl);
    }
    
    .section-title {
        font-size: var(--text-xl);
    }
    
    .btn {
        padding: var(--spacing-xs) var(--spacing-md);
        font-size: var(--text-xs);
    }
    
    .feature-card,
    .course-card,
    .resource-card {
        padding: var(--spacing-md);
    }
    
    .contact-form {
        padding: var(--spacing-md);
    }
}

/* ===== Landscape Orientation ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--spacing-lg) 0;
    }
    
    .hero-content {
        gap: var(--spacing-lg);
    }
    
    .hero-title {
        font-size: var(--text-3xl);
    }
    
    .hero-buttons {
        margin-top: var(--spacing-md);
    }
}

/* ===== High DPI Displays ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .nav-brand .logo img,
    .footer-logo img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===== Print Styles ===== */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .header,
    .footer,
    .back-to-top,
    .nav-toggle,
    .hero-buttons {
        display: none !important;
    }
    
    .hero {
        min-height: auto;
        padding: var(--spacing-lg) 0;
    }
    
    section {
        padding: var(--spacing-lg) 0;
        page-break-inside: avoid;
    }
    
    .feature-card,
    .course-card,
    .resource-card {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    .btn {
        border: 1px solid #000;
    }
}

/* ===== Dark Mode Support ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1f2937;
        --bg-secondary: #111827;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-light: #9ca3af;
    }
    
    .header {
        background: rgba(31, 41, 55, 0.95);
    }
    
    .hero {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    }
    
    .code-editor {
        background: #000;
    }
    
    .editor-header {
        background: #1f2937;
    }
    
    .feature-card,
    .course-card,
    .resource-card {
        background: #1f2937;
        border: 1px solid #374151;
    }
    
    .contact-form {
        background: #1f2937;
        border: 1px solid #374151;
    }
    
    .form-group input,
    .form-group textarea {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .hero::before {
        animation: none;
    }
    
    .code-editor:hover {
        transform: none;
    }
    
    .feature-card:hover,
    .course-card:hover,
    .resource-card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .social-link:hover {
        transform: none;
    }
    
    .back-to-top:hover {
        transform: none;
    }
}
