/**
 * Custom CSS for TPA Management System
 */

/* Sidebar Styling */
.sidebar {
    background: linear-gradient(135deg, #006064 0%, #2E7D32 100%);
    min-height: 100vh;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    margin: 5px 0;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    transform: translateX(5px);
}

/* Content Wrapper */
.content-wrapper {
    background: #f8f9fa;
    min-height: 100vh;
}

/* Statistics Cards */
.stat-card {
    border-radius: 15px;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

/* Action Buttons */
.btn-action {
    margin: 0 2px;
    padding: 0.25rem 0.5rem;
}

/* Action Column */
.action-column {
    min-width: 120px;
    white-space: nowrap;
}

.action-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    justify-content: flex-start;
}

/* Export Info */
.export-info {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 0 auto;
    padding-top: 100px;
}

.login-page {
    background: linear-gradient(135deg, #006064 0%, #2E7D32 100%);
    min-height: 100vh;
}

.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: linear-gradient(135deg, #006064 0%, #2E7D32 100%);
    color: white;
    border-radius: 15px 15px 0 0 !important;
}

/* Table Responsive */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile Table Improvements */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.85rem;
        border-radius: 8px;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }
    
    .table thead th {
        font-size: 0.8rem;
        font-weight: 600;
    }
    
    /* Stack table on very small screens */
    @media (max-width: 576px) {
        .table-stack {
            display: block;
            width: 100%;
        }
        
        .table-stack thead,
        .table-stack tbody,
        .table-stack th,
        .table-stack td,
        .table-stack tr {
            display: block;
        }
        
        .table-stack thead tr {
            position: absolute;
            top: -9999px;
            left: -9999px;
        }
        
        .table-stack tr {
            border: 1px solid #ccc;
            border-radius: 8px;
            margin-bottom: 10px;
            padding: 10px;
            background: white;
        }
        
        .table-stack td {
            border: none;
            border-bottom: 1px solid #eee;
            position: relative;
            padding-left: 50% !important;
            padding-right: 10px;
            padding-top: 8px;
            padding-bottom: 8px;
        }
        
        .table-stack td:before {
            content: attr(data-label);
            position: absolute;
            left: 6px;
            width: 45%;
            padding-right: 10px;
            white-space: nowrap;
            font-weight: bold;
            color: #333;
        }
        
        .table-stack td:last-child {
            border-bottom: 0;
        }
    }
}

/* Form Styling */
.form-control:focus {
    border-color: #00838F;
    box-shadow: 0 0 0 0.2rem rgba(0, 131, 143, 0.25);
}

.form-select:focus {
    border-color: #00838F;
    box-shadow: 0 0 0 0.2rem rgba(0, 131, 143, 0.25);
}

/* Button Styling */
.btn-primary {
    background: linear-gradient(135deg, #006064 0%, #2E7D32 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #004D4F 0%, #1B5E20 100%);
    transform: translateY(-2px);
}

/* Modal Styling */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    border-radius: 15px 15px 0 0;
}

/* Alert Styling */
.alert {
    border-radius: 10px;
    border: none;
}

/* Badge Styling */
.badge {
    font-size: 0.75em;
}

/* Loading Animation */
.loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.spinner-border {
    color: #00838F;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
    }
    
    .btn-action {
        margin: 1px;
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 1px;
    }
    
    .action-column {
        min-width: 80px;
    }
    
    /* Additional mobile optimizations */
    .container-fluid {
        padding: 0.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .btn-sm {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .content-wrapper {
        padding: 0.5rem;
    }
    
    .card-body {
        padding: 1rem 0.75rem;
    }
    
    .btn-action {
        font-size: 0.7rem;
        padding: 0.15rem 0.3rem;
    }
    
    .action-buttons {
        gap: 2px;
    }
    
    .table-responsive {
        margin: 0 -0.75rem;
        border-radius: 0;
    }
}