/* ==========================================================================
   RESPONSIVE DESIGN (TABLET & SMARTPHONE)
   ========================================================================== */

/* TABLET (max-width: 992px) */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .sidebar::-webkit-scrollbar {
        display: none;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content,
    .sidebar.collapsed~.sidebar-overlay~.main-content,
    .sidebar.collapsed~.main-content {
        margin-left: 0 !important;
        min-width: 0;
        width: 100%;
        overflow-x: hidden;
    }

    .mobile-topbar {
        display: flex;
    }

    .content-wrapper {
        padding: 30px 20px;
        min-width: 0;
        width: 100%;
        overflow-x: hidden;
        margin-top: 72px;
    }

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

    .viewer-container {
        padding: 20px;
        margin-top: 10px;
    }
}

/* MOBILE LARGE (max-width: 768px) */
@media (max-width: 768px) {
    .doc-type-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .doc-type-card {
        padding: 20px;
        display: flex;
        align-items: center;
        text-align: left;
        gap: 16px;
    }

    .doc-type-icon {
        margin: 0;
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
        flex-shrink: 0;
    }

    .doc-type-card h3 {
        margin-bottom: 4px;
        font-size: 1.1rem;
    }

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

    .form-card {
        padding: 20px;
    }

    .form-row {
        flex-direction: column;
        gap: 16px;
    }

    .wizard-header h1 {
        font-size: 1.8rem;
    }

    .radio-card-group {
        flex-direction: column;
        gap: 10px;
    }

    .radio-card {
        padding: 14px;
    }

    .step-indicator {
        gap: 5px;
    }

    .step-item {
        width: 75px;
    }

    .step-label {
        font-size: 0.7rem;
    }

    .step-line {
        width: 20px;
        margin-top: 17px;
    }

    /* Paper Mobile Adaptations */
    .viewer-container {
        padding: 10px;
        background: var(--clr-bg);
    }

    .paper-sheet {
        padding: 20px;
        /* Reduced from 2.54cm for mobile readability */
        font-size: 11pt;
        border-radius: 8px;
    }

    .viewer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 15px;
    }

    .viewer-actions {
        width: 100%;
    }

    .viewer-actions button {
        width: 100%;
        justify-content: center;
    }

    /* Paper Actions Mobile */
    .paper-actions {
        right: 10px;
        top: 10px;
        flex-direction: row;
    }

    .btn-paper-action {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .btn-paper-action::after {
        display: none;
        /* Hide tooltips on mobile */
    }

    .chat-revision-box {
        flex-direction: column;
        padding: 12px;
        gap: 8px;
        border-radius: 12px;
    }

    .chat-revision-box input {
        padding: 12px;
    }

    .chat-revision-box button {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }
}

/* MOBILE SMALL (max-width: 480px) */
@media (max-width: 480px) {
    .content-wrapper {
        padding: 20px 12px;
    }

    .wizard-actions {
        flex-direction: column;
        gap: 12px;
    }

    .btn-wizard {
        width: 100%;
        justify-content: center;
    }

    .btn-next,
    .btn-generate {
        margin-left: 0;
    }

    .step-line {
        display: none;
        /* Hide lines to save space */
    }

    .step-item {
        width: 60px;
    }

    .step-dot {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .paper-sheet {
        padding: 16px;
        font-size: 10.5pt;
    }
}