/* ==============================================
   MOBILE & TABLET RESPONSIVE FIXES
   Target: Mobile (< 768px) & Tablet (768px - 1024px)
   Desktop (> 1024px) tetap aman
   ============================================== */

/* ===== GLOBAL CONTAINER FIXES ===== */
@media (max-width: 1024px) {
    /* Lebarkan container di mobile & tablet */
    .container {
        max-width: 100%;
        padding: 0 1.5rem; /* Lebih lebar dari sebelumnya (1rem) */
    }
    
    /* Card lebih lebar */
    .card {
        max-width: 100%;
        margin: 0 auto;
        padding: 1.5rem;
    }
}

/* ===== LOGIN & SIGNUP PAGES ===== */
@media (max-width: 1024px) {
    /* Login/Signup container lebih lebar */
    .container[style*="max-width: 400px"],
    .container[style*="max-width: 500px"] {
        max-width: 90% !important; /* Lebih lebar, kurangi whitespace */
        padding: 0 1rem !important;
    }
    
    /* Card di login/signup lebih lebar */
    div[style*="max-width: 400px"] .card,
    div[style*="max-width: 500px"] .card {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 768px) {
    /* Mobile: lebih lebar lagi */
    .container[style*="max-width: 400px"],
    .container[style*="max-width: 500px"] {
        max-width: 95% !important;
    }
}

/* ===== DASHBOARD & CALENDAR ===== */
@media (max-width: 1024px) {
    /* Dashboard cards lebih lebar */
    .dashboard-grid,
    .children-grid {
        grid-template-columns: 1fr; /* Stack di mobile/tablet */
        gap: 1rem;
    }
    
    /* Calendar container lebih lebar */
    .calendar-container {
        max-width: 100%;
        padding: 1rem;
    }
    
    /* Schedule table responsive */
    .schedule-table {
        font-size: 0.9rem;
    }
    
    .schedule-table th,
    .schedule-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* ===== FEATURE REQUEST PAGE FIX ===== */
@media (max-width: 1024px) {
    /* Filter buttons lebih rapi */
    .filter-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
        margin-bottom: 1rem;
    }
    
    .filter-buttons .btn,
    .filter-buttons button {
        flex: 1 1 calc(50% - 0.5rem); /* 2 kolom di mobile */
        min-width: 120px;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Sort & New Request button */
    .sort-new-container {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .sort-new-container select,
    .sort-new-container .btn {
        width: 100%;
    }
    
    /* Feature request cards */
    .feature-request-card {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .feature-request-card h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    /* Vote buttons lebih compact */
    .vote-section {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
        margin-right: 1rem;
    }
    
    .vote-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        min-width: 90px;
    }
    
    /* Tags lebih kecil */
    .feature-tag,
    .status-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.75rem;
    }
}

@media (max-width: 768px) {
    /* Mobile: filter buttons 1 kolom */
    .filter-buttons .btn,
    .filter-buttons button {
        flex: 1 1 100%;
    }
}

/* ===== ROADMAP PAGE FIX ===== */
@media (max-width: 1024px) {
    /* Roadmap timeline lebih rapi */
    .roadmap-timeline {
        padding-left: 1rem;
    }
    
    .roadmap-item {
        margin-bottom: 1.5rem;
        padding-left: 1.5rem;
        border-left: 3px solid var(--color-primary);
    }
    
    .roadmap-item h3 {
        font-size: 1.1rem;
    }
    
    .roadmap-item p {
        font-size: 0.9rem;
    }
    
    /* Roadmap cards */
    .roadmap-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Progress bars */
    .progress-bar {
        height: 8px;
        border-radius: 4px;
    }
}

/* ===== LANDING PAGE - TUTORIAL SECTION FIX ===== */
@media (max-width: 1024px) {
    /* Tutorial steps lebih rapi */
    .tutorial-steps {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .tutorial-step {
        display: flex;
        flex-direction: column;
        background: white;
        border-radius: var(--radius-md);
        padding: 1.5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }
    
    .tutorial-step-number {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        background: var(--color-primary);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        font-weight: bold;
        margin: 0 auto 1rem auto;
    }
    
    .tutorial-step-content {
        text-align: center;
    }
    
    .tutorial-step-content h3 {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
        color: var(--color-text);
    }
    
    .tutorial-step-content p {
        font-size: 0.95rem;
        line-height: 1.6;
        color: #666;
    }
    
    /* Tutorial checklist */
    .tutorial-checklist {
        list-style: none;
        padding: 0;
        margin: 1rem 0;
    }
    
    .tutorial-checklist li {
        padding: 0.5rem 0;
        padding-left: 2rem;
        position: relative;
        font-size: 0.9rem;
    }
    
    .tutorial-checklist li::before {
        content: "✓";
        position: absolute;
        left: 0;
        color: var(--color-primary);
        font-weight: bold;
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    /* Mobile: tutorial steps lebih compact */
    .tutorial-step {
        padding: 1.25rem;
    }
    
    .tutorial-step-number {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .tutorial-step-content h3 {
        font-size: 1.1rem;
    }
    
    .tutorial-step-content p {
        font-size: 0.9rem;
    }
}

/* ===== ATUR RUTINITAS PAGE ===== */
@media (max-width: 1024px) {
    /* Form lebih lebar */
    .routine-form {
        max-width: 100%;
        padding: 1.5rem;
    }
    
    .routine-form .form-group {
        margin-bottom: 1.25rem;
    }
    
    .routine-form label {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
        display: block;
    }
    
    .routine-form input,
    .routine-form select,
    .routine-form textarea {
        width: 100%;
        padding: 0.75rem;
        font-size: 1rem;
        border-radius: var(--radius-sm);
        border: 2px solid #ddd;
    }
    
    .routine-form button {
        width: 100%;
        padding: 1rem;
        font-size: 1.1rem;
    }
}

/* ===== GENERAL MOBILE IMPROVEMENTS ===== */
@media (max-width: 1024px) {
    /* Buttons lebih besar untuk touch */
    .btn {
        min-height: 44px; /* Apple touch target size */
        padding: 0.75rem 1.5rem;
    }
    
    /* Input fields lebih besar */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        min-height: 44px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Modal lebih lebar */
    .modal-content {
        width: 90%;
        margin: 10% auto;
        padding: 1.5rem;
    }
    
    /* Tables responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Spacing adjustments */
    section {
        padding: 2rem 0;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
}

/* ===== TABLET SPECIFIC (768px - 1024px) ===== */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Tablet: 2 kolom untuk beberapa grid */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-buttons .btn,
    .filter-buttons button {
        flex: 1 1 calc(33.333% - 0.5rem); /* 3 kolom di tablet */
    }
}

/* ===== MOBILE SPECIFIC (< 768px) ===== */
@media (max-width: 767px) {
    /* Mobile: semua 1 kolom */
    .features-grid,
    .dashboard-grid,
    .children-grid {
        grid-template-columns: 1fr;
    }
    
    /* Reduce padding di mobile */
    .container {
        padding: 0 1rem;
    }
    
    .card {
        padding: 1.25rem;
    }
    
    /* Hero section lebih compact */
    .hero {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
}
