/* My Applications Section - DHA Bahawalpur */
/* Complete Responsive Design for All Screen Sizes */

/* Base My Applications Section Styles */
#my-applications-section {
    display: none;
}

#my-applications-section.active {
    display: block;
    animation: fadeInUp 0.4s ease-out;
}
#user-applications-section {
    display: none;
}

#user-applications-section.active {
    display: block;
    animation: fadeInUp 0.4s ease-out;
}

.applications-container {
    padding: 2rem;
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    margin-bottom: 2rem;
}

.applications-container h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.applications-container h2 i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.applications-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Filters and Controls Section */
.applications-controls {
    display: flex;
    justify-content: between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.applications-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.applications-search {
    flex: 1;
    max-width: 300px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(234, 85, 71, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Applications Table Container */
.applications-table-container {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.applications-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Poppins', sans-serif;
    min-width: 800px;
}

.applications-table thead {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.applications-table thead th {
    padding: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.applications-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #f1f5f9;
}

.applications-table tbody tr:hover {
    background: #f8fafc;
}

.applications-table tbody tr:last-child {
    border-bottom: none;
}

.applications-table tbody td {
    padding: 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    vertical-align: middle;
}

.applications-table tbody td:first-child {
    font-weight: 600;
    color: var(--primary-color);
}

/* Status Badges */
.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    min-width: 110px;
    width: auto;
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
}

.status-badge.approved {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.rejected {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.under-review {
    background: #dbeafe;
    color: #1e40af;
}

/* Table Action Buttons */
.table-action-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem;
    margin: 0 0.2rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    vertical-align: middle;
}

.table-action-btn:hover {
    background: white;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.table-action-btn.view:hover {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #3b82f6;
}

.table-action-btn.edit:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #f59e0b;
}

.table-action-btn.download:hover {
    background: #d1fae5;
    border-color: #10b981;
    color: #10b981;
}

/* Actions Column - Ensure horizontal alignment */
.applications-table tbody td:last-child {
    white-space: nowrap;
    text-align: center;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    justify-content: center;
}

/* Mobile Applications Cards (Hidden by default) */
.mobile-applications-cards {
    display: none;
    gap: 1rem;
}

.mobile-app-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.mobile-app-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(234, 85, 71, 0.1);
    border-color: var(--primary-color);
}

.mobile-app-card .app-id {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

.mobile-app-info {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mobile-app-info-item {
    display: flex;
    justify-content: between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.mobile-app-info-item:last-child {
    border-bottom: none;
}

.mobile-app-info-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    flex: 1;
}

.mobile-app-info-value {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: right;
}

.mobile-app-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

/* Empty State */
.applications-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.applications-empty i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: #cbd5e1;
}

.applications-empty h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.applications-empty p {
    font-size: 1rem;
    margin-bottom: 2rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: #d63431;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 85, 71, 0.3);
}

/* Loading State */
.applications-loading {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f1f5f9;
    border-left: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== RESPONSIVE DESIGN ==================== */

/* Tablet View (768px) */
@media (max-width: 768px) {
    .applications-container {
        padding: 1.5rem;
        margin: 1rem;
        border-radius: 12px;
    }
    
    .applications-container h2 {
        font-size: 1.5rem;
    }
    
    .applications-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .applications-filters {
        order: 2;
        justify-content: center;
    }
    
    .applications-search {
        order: 1;
        max-width: none;
    }
    
    .applications-table-container {
        overflow-x: auto;
    }
    
    .applications-table {
        min-width: 700px;
    }
    
    .applications-table thead th,
    .applications-table tbody td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .status-badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
        min-width: 70px;
    }
    
    .table-action-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
        margin: 0 0.1rem;
    }
}

/* Large Mobile (480px-767px) */
@media (max-width: 767px) and (min-width: 481px) {
    .applications-table {
        min-width: 650px;
    }
    
    .filter-btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Small Mobile (425px-480px) */
@media (max-width: 480px) {
    .applications-container {
        padding: 1rem;
        margin: 0.5rem;
        border-radius: 8px;
    }
    
    .applications-container h2 {
        font-size: 1.3rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .applications-subtitle {
        text-align: center;
        font-size: 0.9rem;
    }
    
    .applications-controls {
        gap: 0.75rem;
    }
    
    .filter-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    .search-input {
        font-size: 0.85rem;
        padding: 0.6rem 1rem 0.6rem 2.2rem;
    }
    
    /* Switch to card layout on mobile */
    .applications-table-container {
        display: none;
    }
    
    .mobile-applications-cards {
        display: block;
    }
    
    .mobile-app-card {
        padding: 1.2rem;
        border-radius: 8px;
    }
    
    .mobile-app-card .app-id {
        font-size: 0.9rem;
    }
    
    .mobile-app-info-label {
        font-size: 0.8rem;
    }
    
    .mobile-app-info-value {
        font-size: 0.85rem;
    }
    
    .table-action-btn {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
}

/* Extra Small Mobile (320px-424px) */
@media (max-width: 424px) {
    .applications-container {
        padding: 0.75rem;
        margin: 0.25rem;
    }
    
    .applications-container h2 {
        font-size: 1.2rem;
    }
    
    .applications-filters {
        gap: 0.5rem;
    }
    
    .filter-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }
    
    .mobile-app-card {
        padding: 1rem;
    }
    
    .mobile-app-info-label {
        font-size: 0.75rem;
    }
    
    .mobile-app-info-value {
        font-size: 0.8rem;
    }
    
    .status-badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }
    
    .table-action-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
}

/* Desktop/Laptop (1024px+) */
@media (min-width: 1024px) {
    .applications-container {
        padding: 2.5rem;
    }
    
    .applications-container h2 {
        font-size: 2rem;
    }
    
    .applications-controls {
        margin-bottom: 2.5rem;
    }
    
    .applications-search {
        max-width: 350px;
    }
    
    .applications-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .applications-table {
        min-width: 900px;
    }
    
    .applications-table thead th {
        padding: 1.2rem;
        font-size: 0.95rem;
    }
    
    .applications-table tbody td {
        padding: 1.2rem;
        font-size: 0.95rem;
        vertical-align: middle;
    }
    
    .applications-table tbody td:last-child {
        white-space: nowrap;
        text-align: center;
    }
    
    .table-actions {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        justify-content: center;
    }
    
    .status-badge {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
        min-width: 90px;
    }
    
    .table-action-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        margin: 0 0.1rem;
    }
}

/* Large Screen Optimization (2198px - 2560px) */
@media (min-width: 2198px) and (max-width: 2560px) {
    .applications-container {
        padding: 3rem;
        max-width: 1600px;
        margin: 0 auto 3rem auto;
    }
    
    .applications-container h2 {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .applications-container h2 i {
        font-size: 2rem;
    }
    
    .applications-subtitle {
        font-size: 1.2rem;
        margin-bottom: 3rem;
    }
    
    .applications-controls {
        margin-bottom: 3rem;
        gap: 2rem;
    }
    
    .applications-filters {
        gap: 1.5rem;
    }
    
    .filter-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        border-radius: 12px;
        font-weight: 600;
    }
    
    .applications-search {
        max-width: 400px;
    }
    
    .search-input {
        padding: 1rem 1.5rem 1rem 3rem;
        font-size: 1rem;
        border-radius: 12px;
        border-width: 2px;
    }
    
    .search-icon {
        left: 1rem;
        font-size: 1rem;
    }
    
    .applications-table-container {
        border-radius: 20px;
        border-width: 2px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .applications-table {
        min-width: 1000px;
    }
    
    .applications-table thead {
        background: #f1f5f9;
    }
    
    .applications-table thead th {
        padding: 1.5rem;
        font-size: 1.1rem;
        font-weight: 700;
    }
    
    .applications-table tbody td {
        padding: 1.5rem;
        font-size: 1.1rem;
    }
    
    .status-badge {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
        min-width: 100px;
        border-radius: 25px;
    }
    
    .table-action-btn {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
        border-radius: 12px;
        border-width: 2px;
        margin: 0 0.3rem;
    }
    
    .table-action-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    }
    
    /* Mobile cards for large screens if needed */
    .mobile-app-card {
        padding: 2rem;
        border-radius: 16px;
        border-width: 2px;
    }
    
    .mobile-app-card .app-id {
        font-size: 1.2rem;
    }
    
    .mobile-app-info-label {
        font-size: 1rem;
    }
    
    .mobile-app-info-value {
        font-size: 1.1rem;
    }
    
    .applications-empty {
        padding: 6rem 3rem;
    }
    
    .applications-empty i {
        font-size: 5rem;
    }
    
    .applications-empty h3 {
        font-size: 2rem;
    }
    
    .applications-empty p {
        font-size: 1.2rem;
    }
    
    .btn-primary {
        padding: 1rem 2rem;
        font-size: 1.1rem;
        border-radius: 12px;
    }
}

/* Ultra-wide screens (2560px+) */
@media (min-width: 2561px) {
    .applications-container {
        max-width: 1800px;
        padding: 4rem;
    }
    
    .applications-container h2 {
        font-size: 3rem;
    }
    
    .applications-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .applications-table {
        min-width: 1200px;
    }
    
    .applications-table thead th {
        padding: 2rem;
        font-size: 1.3rem;
    }
    
    .applications-table tbody td {
        padding: 2rem;
        font-size: 1.3rem;
    }
}

/* Landscape Orientation Adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .applications-container {
        padding: 1rem;
    }
    
    .applications-container h2 {
        font-size: 1.3rem;
    }
    
    .applications-controls {
        flex-direction: row;
        gap: 1rem;
    }
    
    .applications-filters {
        order: 1;
    }
    
    .applications-search {
        order: 2;
        max-width: 250px;
    }
}

/* Print Styles */
@media print {
    .applications-controls,
    .table-action-btn,
    .mobile-app-actions {
        display: none !important;
    }
    
    .applications-container {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        padding: 1rem !important;
    }
    
    .applications-table {
        font-size: 12px !important;
    }
    
    .status-badge {
        background: white !important;
        color: #000 !important;
        border: 1px solid #ddd !important;
    }
} 