/**
 * NDIS Team Management System - Main Styles
 * Mobile-First Responsive Design
 */

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #0ea5e9;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--light-color);
}

/* ==================== LAYOUT ==================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== HEADER ==================== */
.header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--light-color);
    padding: 4px 10px;
    border-radius: 12px;
}

/* ==================== NAVIGATION ==================== */
.nav {
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-menu::-webkit-scrollbar {
    height: 3px;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.nav-item {
    white-space: nowrap;
}

.nav-link {
    display: block;
    padding: 15px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    padding: 20px;
}

.page-header {
    margin-bottom: 30px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ==================== CARDS ==================== */
.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    font-size: 14px;
}

/* ==================== STATS CARDS ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

@media (min-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control:disabled {
    background: var(--light-color);
    cursor: not-allowed;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== ALERTS ==================== */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--secondary-color);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

/* ==================== LOGIN PAGE ==================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 20px;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ==================== TABLES ==================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--light-color);
}

.table tr:hover {
    background: var(--light-color);
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
    white-space: nowrap;
}

.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* ==================== UTILITIES ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .page-title {
        font-size: 24px;
    }
    
    .login-container {
        padding: 30px 20px;
    }
    
    .user-info {
        flex-direction: column;
        align-items: flex-end;
        gap: 5px;
    }
}

/* ===========================
   PAGINATION STYLES
   =========================== */

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding: 20px 0;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.pagination-links {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.pagination-link:hover:not(.disabled):not(.active) {
    background: #f9fafb;
    border-color: #2563eb;
    color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pagination-link.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    cursor: default;
    font-weight: 600;
}

.pagination-link.disabled {
    color: #d1d5db;
    cursor: not-allowed;
    background: #f9fafb;
    border-color: #e5e7eb;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    color: #6b7280;
    font-weight: 500;
    font-size: 16px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .pagination {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .pagination-info {
        text-align: center;
        order: 1;
    }
    
    .pagination-links {
        justify-content: center;
        order: 2;
    }
    
    .pagination-link {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
        padding: 0 10px;
    }
}

/* Print: Hide pagination */
@media print {
    .pagination {
        display: none !important;
    }
}