﻿/* ==========================================
   Mobile Hamburger Toggle Button
   (hidden on desktop, shown on mobile via media query below)
   ========================================== */
.hamburger-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 1201;
}

    .hamburger-btn span {
        display: block;
        width: 18px;
        height: 2px;
        background: #1d1d1f;
        border-radius: 2px;
        position: relative;
        transition: background-color 0.2s ease;
    }

        .hamburger-btn span::before,
        .hamburger-btn span::after {
            content: '';
            position: absolute;
            left: 0;
            width: 18px;
            height: 2px;
            background: #1d1d1f;
            border-radius: 2px;
            transition: transform 0.2s ease, top 0.2s ease;
        }

        .hamburger-btn span::before {
            top: -6px;
        }

        .hamburger-btn span::after {
            top: 6px;
        }

    .hamburger-btn.open span {
        background: transparent;
    }

        .hamburger-btn.open span::before {
            top: 0;
            transform: rotate(45deg);
        }

        .hamburger-btn.open span::after {
            top: 0;
            transform: rotate(-45deg);
        }

html.dark-mode .hamburger-btn {
    background: #1e1e22;
    border-color: rgba(255,255,255,0.1);
}

    html.dark-mode .hamburger-btn span,
    html.dark-mode .hamburger-btn span::before,
    html.dark-mode .hamburger-btn span::after {
        background: #f0f0f2;
    }

/* Overlay behind the drawer */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1150;
    opacity: 0;
    transition: opacity 0.25s ease;
}

    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }

@media (max-width: 767px) {
    /* Fix ghost spacing caused by inactive panel affecting auto height */
    .auth-panel-container {
        display: block !important;
        align-items: unset !important;
    }

    .auth-panel {
        display: none;
    }

        .auth-panel.active {
            display: block !important;
        }

    /* Tighten spacing for compact mobile card */
    .form-group {
        margin-bottom: 16px;
    }

    .otp-boxes {
        display: flex;
        gap: 10px;
        width: 100%;
        margin-bottom: 20px;
    }

    .otp-box {
        flex: 1;
        min-width: 0;
        width: auto;
        height: 56px;
        font-size: 20px;
    }
    .auth-title {
        margin-bottom: 6px;
    }

    .auth-subtitle {
        margin-bottom: 20px;
    }
}

/* Tablet-specific tightening (iPad-ish widths) */
@media (min-width: 768px) and (max-width: 1024px) {
    .auth-card {
        width: 92%;
        height: auto;
        min-height: 500px;
    }

    .auth-right {
        padding: 36px 40px;
    }

    .form-group {
        margin-bottom: 20px;
    }
}

/* ==========================================
   Auth Card Centering + Logo Panel (Phones/Tablets <= 767px)
   ========================================== */
@media (max-width: 767px) {
    .desktop-container {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 20px 16px;
        overflow-y: auto;
    }

    .auth-card {
        margin: 0 auto;
    }

    .auth-left {
        min-height: 220px;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 28px 16px !important;
        border-radius: 20px 20px 0 0;
    }

        .auth-left img {
            width: 130px !important;
            margin: 0 auto;
        }

        .auth-left h2 {
            font-size: 13px !important;
            margin-top: -4px !important;
            letter-spacing: 1px !important;
            text-align: center;
            width: 100%;
        }

    .auth-right {
        border-radius: 0 0 20px 20px;
    }
}

@media (max-width: 400px) {
    .auth-left {
        min-height: 170px;
    }

        .auth-left img {
            width: 110px !important;
        }
}

/* Shrink logo panel when viewport height is short (keyboard open on phones) */
@media (max-width: 767px) and (max-height: 700px) {
    .auth-left {
        min-height: 120px !important;
        padding: 14px 16px !important;
    }

        .auth-left img {
            width: 90px !important;
        }

        .auth-left h2 {
            font-size: 11px !important;
        }

    .auth-card {
        max-height: 96vh;
        max-height: 96dvh;
    }
}

/* Auto-height + rounded corners only for single-column phone layout,
   where the auth-left blue panel is hidden entirely (below md/768px) */
@media (max-width: 767px) {
    .auth-card {
        width: 92% !important;
        max-width: 420px;
        border-radius: 20px;
        height: auto !important;
        min-height: 0 !important;
        max-height: 92vh;
    }

    .auth-panel-container {
        height: auto !important;
    }

    .auth-panel.active {
        position: relative !important;
    }

    .dashboard-container {
        height: 100vh;
        border-radius: 0;
        max-width: 100%;
    }

    .hamburger-btn {
        display: inline-flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 260px;
        max-width: 80vw;
        z-index: 1200;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        background: #ffffff;
        border-right: 0.5px solid rgba(0, 0, 0, 0.08);
        flex-direction: column;
        align-items: stretch;
        overflow-y: auto;
        box-shadow: 0 0 30px rgba(0,0,0,0.15);
    }

        .sidebar.sidebar-open {
            transform: translateX(0);
        }

    html.dark-mode .sidebar {
        background: #1e1e22;
    }

    .sidebar-top {
        gap: 24px;
    }

    .sidebar-logo {
        padding-left: 4px;
    }

    .content-header {
        padding: 16px 16px 12px 16px;
        gap: 10px;
        flex-wrap: nowrap;
    }

    .header-title-section {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        min-width: 0;
        flex: 1;
    }

    .header-greeting {
        font-size: 17px;
        letter-spacing: -0.3px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-date {
        display: none;
    }

    .header-right {
        gap: 8px;
    }

    .user-profile-card .profile-info {
        display: none;
    }

    .user-profile-card {
        padding: 4px;
    }

    .feed-content {
        padding: 0 14px 24px 14px;
        gap: 18px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stats-card {
        padding: 14px;
        border-radius: 14px;
        gap: 10px;
    }

    .stats-card-title {
        font-size: 12px;
    }

    .stats-card-value {
        font-size: 20px;
    }

    .stats-card-trend {
        font-size: 11px;
    }

    .stats-card-icon {
        width: 32px;
        height: 32px;
        border-radius: 9px;
    }

        .stats-card-icon svg {
            width: 16px;
            height: 16px;
        }

    .report-filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 10px;
    }

    .filter-field {
        width: 100%;
    }

    .filter-select {
        width: 100%;
        min-width: 0;
    }

    .filter-actions {
        margin-left: 0;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .search-wrap {
        width: 100%;
    }

        .search-wrap input {
            width: 100%;
            flex: 1;
        }

    .btn-apply, .btn-outline {
        width: 100%;
        justify-content: center;
        font-size: 13px;
    }

    .report-tabs-row {
        flex-direction: column;
        align-items: stretch;
    }

        .report-tabs-row > div {
            width: 100%;
        }

        .report-tabs-row button {
            flex: 1;
            justify-content: center;
        }

    #daily-standups-table-wrap table {
        font-size: 12.5px;
        min-width: 640px;
    }

    .rep-th, .rep-td {
        padding: 8px 10px;
        white-space: nowrap;
    }

        .rep-td[style*="max-width"] {
            white-space: normal !important;
            min-width: 140px;
        }

    .pagination-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    #pagination-summary-text {
        font-size: 12px;
    }

    .pagination-btn {
        min-width: 28px;
        height: 28px;
        font-size: 12px;
    }

    #profile-dropdown {
        width: 200px;
        right: 0;
        top: 46px;
    }

    .sidebar-item, .dropdown-parent {
        font-size: 13.5px;
    }

    .form-panel-wrapper {
        padding: 0 14px 24px 14px;
    }

    .form-container-card {
        padding: 18px;
        gap: 20px;
        border-radius: 16px;
    }

    .form-card-title {
        font-size: 20px;
        padding: 16px 4px 8px 4px;
    }

    .form-section-title {
        font-size: 15px;
    }

    .form-textarea, .form-select {
        font-size: 14px;
    }

    .form-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        height: 46px;
        font-size: 15px;
    }

    .toast-container {
        left: 12px;
        right: 12px;
        bottom: 16px;
    }

    .toast {
        width: 100%;
    }

    /* Dropdown/select options rendering fix on mobile */
    select.filter-select,
    #period-selector,
    #employee-selector {
        -webkit-appearance: none;
        appearance: none;
        position: relative;
        font-size: 14px;
    }
}

@media (max-width: 400px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .header-greeting {
        font-size: 15px;
    }

    .sidebar-logo img {
        height: 36px;
    }
}
