﻿/* ============================================== */
/* PROJECT OVERVIEW RESPONSIVE STYLES            */
/* Supports: Desktop, Tablet, and Mobile         */
/* Breakpoints: 1024px (tablet), 600px (mobile)  */
/* ============================================== */

/* ============ DESKTOP/MOBILE VIEW TOGGLE ============ */
/* Default: Show desktop, hide mobile */
.desktop-view {
    display: block;
}

.mobile-view {
    display: none;
}

/* ============ TABLET & MOBILE (up to 1024px) ============ */
@media screen and (max-width: 1024px) {
    /* Toggle views: Hide desktop, show card view */
    .desktop-view {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    .mobile-view {
        display: block !important;
        visibility: visible !important;
    }

    /* Search Box */
    .mobile-search-box {
        padding: 10px;
        background: #f8f9fa;
        border-radius: 8px;
        margin-bottom: 15px;
    }

        .mobile-search-box .input-group {
            max-width: 100%;
        }

        .mobile-search-box input {
            font-size: 16px !important; /* Prevents iOS zoom */
        }

    /* Loading State */
    .mobile-loading {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px 20px;
        color: #666;
    }

        .mobile-loading p {
            margin-top: 15px;
            font-size: 14px;
        }

    /* No Data State */
    .mobile-no-data {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px 20px;
        color: #999;
    }

        .mobile-no-data p {
            margin-top: 15px;
            font-size: 14px;
        }

    /* Cards Container - default single column */
    .mobile-cards-container {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    /* Project Card */
    .project-card {
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        padding: 12px;
        border-left: 4px solid #FFED00;
    }

        .project-card.conflict-card {
            border-left-color: #e6200a;
            background: #fff9f9;
        }

    /* Card Header Row */
    .card-header-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
    }

    /* Status Badge */
    .status-badge-mobile {
        padding: 4px 10px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
    }

    /* Registration Info */
    .card-reg-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid #eee;
        margin-bottom: 10px;
        gap: 10px;
    }

    .reg-number {
        font-weight: 700;
        color: #333;
        font-size: 15px;
        white-space: nowrap;
    }

    .project-type-badge {
        padding: 4px 10px;
        border-radius: 4px;
        font-size: 11px;
        font-weight: 600;
        white-space: nowrap;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Card Content */
    .card-content {
        padding: 5px 0;
    }

    .card-row {
        display: flex;
        padding: 4px 0;
        font-size: 13px;
        align-items: flex-start;
    }

    .card-label {
        color: #666;
        min-width: 75px;
        max-width: 75px;
        font-weight: 500;
        flex-shrink: 0;
    }

    .card-value {
        color: #333;
        flex: 1;
        word-break: break-word;
        text-align: right;
    }

    /* Dates Row */
    .dates-row {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        flex-wrap: nowrap;
        padding: 8px 0;
    }

    .date-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        flex: 1;
    }

        .date-item:last-child {
            align-items: flex-end;
            text-align: right;
        }

        .date-item .card-label {
            font-size: 11px;
            min-width: unset;
            max-width: unset;
        }

        .date-item .card-value {
            font-size: 13px;
            white-space: nowrap;
        }

    .expired-date {
        color: #dc3545 !important;
        font-weight: 600;
    }

    /* Action Buttons */
    .card-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #eee;
    }

    .action-btn {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        position: relative;
        text-decoration: none;
        font-size: 16px;
    }

        .action-btn i {
            font-size: 16px;
        }

    .action-btn-info {
        background: #17a2b8;
        color: white;
    }

    .action-btn-status {
        background: #28a745;
        color: white;
    }

    .action-btn-edit {
        background: #007bff;
        color: white;
    }

    .action-btn-delete {
        background: #dc3545;
        color: white;
    }

    .action-btn-renew {
        background: #1485db;
        color: white;
    }

    .action-btn-renew-pending {
        background: #e20325;
        color: white;
    }

    .action-btn-expired {
        background: #ffc107;
        color: #333;
        cursor: default;
    }

    .action-btn-approve {
        background: #3eb909;
        color: white;
    }

    .action-btn-deny {
        background: #6c757d;
        color: white;
    }

    /* Renew Badge */
    .renew-badge {
        position: absolute;
        top: -5px;
        right: -5px;
        background: #ff0;
        color: #000;
        font-size: 10px;
        font-weight: 700;
        padding: 2px 6px;
        border-radius: 10px;
    }

    /* Pagination */
    .mobile-pagination {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 10px;
        margin-top: 15px;
        background: #f8f9fa;
        border-radius: 8px;
    }

    .page-btn {
        background: #FFED00;
        color: #333;
        border: none;
        padding: 10px 16px;
        border-radius: 6px;
        font-weight: 600;
        font-size: 14px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 6px;
    }

        .page-btn:disabled {
            background: #e0e0e0;
            color: #999;
            cursor: not-allowed;
        }

    .page-info {
        font-size: 14px;
        color: #666;
        font-weight: 500;
    }

    /* Responsive Dialogs */
    .responsive-dialog-small {
        width: 95% !important;
        max-width: 95% !important;
    }

    .responsive-dialog-medium {
        width: 95% !important;
        max-width: 95% !important;
    }

    .responsive-dialog-large {
        width: 95% !important;
        max-width: 95% !important;
    }

    /* General Adjustments */
    .container-fluid {
        padding: 0 8px !important;
    }

    .leadbrand {
        margin: 10px 0 !important;
    }

    .form-control {
        font-size: 16px !important;
    }
}

/* ============ TABLET OPTIMIZATIONS (601px - 1024px) ============ */
@media screen and (min-width: 601px) and (max-width: 1024px) {
    /* 2-column grid for tablets */
    .mobile-cards-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    /* Larger cards on tablet */
    .project-card {
        padding: 16px;
    }

    /* Better spacing for card rows */
    .card-row {
        font-size: 14px;
    }

    /* Larger action buttons on tablet */
    .action-btn {
        width: 44px;
        height: 44px;
    }

    /* Better pagination layout */
    .mobile-pagination {
        padding: 20px;
        max-width: 500px;
        margin: 20px auto 0 auto;
    }

    /* Centered search box on tablet */
    .mobile-search-box {
        max-width: 500px;
        margin: 0 auto 20px auto;
    }

    /* Wider dialogs on tablet */
    .responsive-dialog-medium {
        width: 70% !important;
        max-width: 700px !important;
    }

    .responsive-dialog-large {
        width: 80% !important;
        max-width: 900px !important;
    }
}

/* ============ SMALL MOBILE ADJUSTMENTS (up to 400px) ============ */
@media screen and (max-width: 400px) {
    /* Smaller text on very small screens */
    .card-row {
        font-size: 12px;
    }

    .card-label {
        min-width: 65px;
        max-width: 65px;
    }

    .status-badge-mobile {
        font-size: 10px;
        padding: 3px 8px;
    }

    .project-type-badge {
        font-size: 10px;
        padding: 3px 6px;
        max-width: 90px;
    }

    .action-btn {
        width: 36px;
        height: 36px;
    }

        .action-btn i {
            font-size: 14px;
        }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .action-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .page-btn {
        min-height: 44px;
    }
}
