/**
 * Mobile Responsive Framework for All Pages
 * Use this CSS for any page that needs mobile responsiveness
 */

/* ============ HAMBURGER MENU STYLES ============ */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #2E7D32;
    border-radius: 3px;
    transition: 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(10px, 10px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ============ NAVBAR RESPONSIVE ============ */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px !important;
        flex-wrap: wrap;
        position: relative;
    }

    .navbar-brand {
        width: 100%;
        margin-bottom: 10px;
    }

    .hamburger {
        display: flex;
        position: absolute;
        right: 20px;
        top: 15px;
    }

    .navbar-menu {
        display: none !important;
        flex-direction: column !important;
        width: 100%;
        background: #f9f9f9;
        border-radius: 5px;
        padding: 15px 0 !important;
        text-align: center;
        position: relative;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        margin-top: 10px;
        gap: 0 !important;
    }

    .navbar-menu.active {
        display: flex !important;
    }

    .navbar-menu li {
        border-bottom: 1px solid #eee;
    }

    .navbar-menu a {
        padding: 12px 20px !important;
        display: block;
    }

    .navbar-user {
        width: 100%;
        flex-direction: column;
        gap: 10px;
        margin-top: 10px;
        border-top: 1px solid #eee;
        padding-top: 10px;
    }

    .navbar-user span {
        font-size: 14px;
    }

    .navbar-logout {
        width: 100%;
        padding: 10px 15px !important;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 10px 15px !important;
    }

    .hamburger {
        right: 15px;
        top: 12px;
    }

    .hamburger span {
        width: 22px;
        height: 2.5px;
    }

    .navbar-brand {
        font-size: 18px;
    }

    .navbar-user {
        padding-top: 8px;
    }
}

/* ============ GRID LAYOUTS RESPONSIVE ============ */
@media (max-width: 768px) {
    .hostels-grid,
    .tabs-content,
    .form-row {
        grid-template-columns: 1fr !important;
    }

    .container {
        padding: 0 10px;
    }
}

/* ============ TYPOGRAPHY RESPONSIVE ============ */
@media (max-width: 768px) {
    .page-title h1 {
        font-size: 24px !important;
    }

    .page-title p {
        font-size: 14px !important;
    }

    .page-header h1 {
        font-size: 24px !important;
    }

    h2 {
        font-size: 20px !important;
    }

    .hostel-number {
        font-size: 22px !important;
    }
}

@media (max-width: 480px) {
    .page-title h1 {
        font-size: 20px !important;
    }

    .page-title p {
        font-size: 12px !important;
    }

    .hostel-number {
        font-size: 18px !important;
    }

    .hostel-location {
        font-size: 12px !important;
    }

    h2 {
        font-size: 18px !important;
    }

    p {
        font-size: 13px !important;
    }
}

/* ============ BUTTON RESPONSIVE ============ */
@media (max-width: 768px) {
    .btn,
    .view-details-btn,
    .tab-btn {
        padding: 10px 15px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 480px) {
    .btn,
    .view-details-btn,
    .tab-btn {
        padding: 10px 12px !important;
        font-size: 12px !important;
        width: 100%;
    }
}

/* ============ TABLE RESPONSIVE ============ */
@media (max-width: 768px) {
    .hostels-table {
        font-size: 12px !important;
    }

    .hostels-table th,
    .hostels-table td {
        padding: 8px 5px !important;
    }
}

@media (max-width: 480px) {
    .hostels-table {
        overflow-x: auto;
        display: block;
    }

    .hostels-table thead {
        display: none;
    }

    .hostels-table tr {
        display: block;
        margin-bottom: 10px;
        border: 1px solid #ddd;
        border-radius: 5px;
        padding: 10px;
    }

    .hostels-table td {
        display: block;
        text-align: right;
        padding-left: 50%;
        position: relative;
    }

    .hostels-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        font-weight: bold;
        text-align: left;
    }
}

/* ============ FORM RESPONSIVE ============ */
@media (max-width: 768px) {
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="file"],
    textarea,
    select {
        font-size: 16px !important; /* Prevents iOS zoom */
    }

    .form-group {
        margin-bottom: 15px !important;
    }

    label {
        font-size: 13px !important;
    }
}

/* ============ FOOTER RESPONSIVE ============ */
@media (max-width: 768px) {
    .footer {
        padding: 15px 10px !important;
        font-size: 12px !important;
    }

    .footer a {
        margin: 0 5px !important;
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 10px 5px !important;
        font-size: 11px !important;
    }

    .footer a {
        display: block;
        margin: 5px 0 !important;
    }
}

/* ============ HELPER CLASSES ============ */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }
}

/* ============ TOUCH FRIENDLY ============ */
@media (max-width: 768px) {
    button,
    a.btn,
    .view-details-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ============ MODAL/POPUP RESPONSIVE ============ */
@media (max-width: 768px) {
    .modal,
    .popup,
    .dialog {
        width: 95% !important;
        max-width: 95% !important;
        margin: auto !important;
    }
}
