/* Family Command Center - Main Stylesheet */

/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-bg: #f8fafc;
    --dark-bg: #1e293b;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background-color: var(--dark-bg);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-menu a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.nav-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-menu a.active {
    background-color: var(--primary-color);
    color: white;
}

.nav-menu .nav-right {
    margin-left: 1rem;
}

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

.btn-logout:hover {
    background-color: #dc2626;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 20px;
}

/* Footer */
.footer {
    background-color: var(--dark-bg);
    color: #cbd5e1;
    padding: 1.5rem 0;
    margin-top: auto;
    text-align: center;
}

.footer p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.login-box .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.login-form {
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
}

.login-footer small {
    display: block;
    margin: 0.25rem 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

.text-muted {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.875rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Dashboard */
.dashboard h2 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.welcome-message {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.dashboard-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.dashboard-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.dashboard-card .card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-align: center;
}

.dashboard-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.dashboard-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Quick Stats */
.quick-stats {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.quick-stats h3 {
    margin-bottom: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: var(--radius);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Module Pages */
.module-page {
    width: 100% !important;
}

.module-page h2 {
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.module-section {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    width: 100% !important;
    box-sizing: border-box;
}

.module-section h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.no-data {
    color: var(--text-secondary);
    font-style: italic;
    padding: 2rem;
    text-align: center;
    background: var(--light-bg);
    border-radius: var(--radius);
}

.no-data code {
    background: #e2e8f0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

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

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

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

.data-table .amount {
    font-weight: 600;
    text-align: right;
}

.data-table .amount.positive {
    color: var(--success-color);
}

.data-table .amount.negative {
    color: var(--danger-color);
}

.data-table tfoot {
    font-weight: 700;
    background-color: var(--light-bg);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: var(--secondary-color);
    color: white;
}

.badge-warning {
    background-color: var(--warning-color);
}

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

.grade-badge {
    background-color: var(--success-color);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Budget Cards */
.budget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.budget-card {
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.budget-card h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.budget-amount {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.budget-amount .spent {
    color: var(--primary-color);
    font-weight: 700;
}

.budget-amount .separator {
    color: var(--text-secondary);
    margin: 0 0.25rem;
}

.budget-amount .budgeted {
    color: var(--text-secondary);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

/* Students & Family Grids */
.students-grid,
.family-grid,
.trips-grid,
.meal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.student-card,
.family-card,
.trip-card,
.meal-card {
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.student-card h4,
.family-card h4,
.trip-card h4,
.meal-card h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.student-card p,
.family-card p {
    margin: 0.5rem 0;
}

.course-list {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.course-list ul {
    list-style: none;
    margin-top: 0.5rem;
}

.course-list li {
    padding: 0.5rem 0;
}

/* Info Box */
.info-box {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary-color);
}

.info-box h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.info-box p {
    margin: 0.5rem 0;
}

.de-students {
    margin-top: 1.5rem;
}

/* Resources List */
.resources-list p {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: var(--light-bg);
    border-radius: var(--radius);
}

.resources-list code {
    background: #e2e8f0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

/* Trip Cards */
.trip-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.trip-highlights ul {
    margin: 0.5rem 0 1rem 1.5rem;
}

.trip-notes {
    font-style: italic;
    color: var(--text-secondary);
    margin-top: 1rem;
}

/* Document Summary */
.document-summary {
    margin-bottom: 2rem;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Insurance Policy Header */
.insurance-policy-header {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--primary-color);
}

.insurance-policy-header h4 {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    color: var(--primary-color);
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.policy-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.policy-detail {
    padding: 0;
}

.policy-detail strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    font-weight: 600;
}

.policy-detail span {
    display: block;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Documents Grid - Desktop First */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.document-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.document-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.doc-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.doc-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.125rem;
}

.doc-info {
    margin: 0.75rem 0;
    font-size: 0.875rem;
}

.doc-info strong {
    color: var(--text-primary);
}

.doc-actions {
    margin-top: 1.5rem;
}

.doc-actions-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.doc-actions-split .btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.875rem;
}

.no-file-notice {
    text-align: center;
    padding: 0.75rem;
    background: var(--light-bg);
    border-radius: var(--radius);
}

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

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

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.category-card {
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.category-card h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.category-card ul {
    list-style: none;
}

.category-card li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
}

.category-card li:before {
    content: "• ";
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Meal Grid */
.meal-card ul {
    list-style: none;
}

.meal-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.meal-card li:last-child {
    border-bottom: none;
}

.meal-card small {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Tabs */
.tabs-container {
    margin-bottom: 2rem;
    width: 100% !important;
}

.tabs-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
    overflow-x: auto;
    width: 100% !important;
}

.tab-button {
    padding: 1rem 2rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-button:hover {
    color: var(--primary-color);
    background: var(--light-bg);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
    width: 100% !important;
}

.tab-content.active {
    display: block !important;
    animation: fadeIn 0.3s;
    width: 100% !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.student-profile {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    width: 100% !important;
    box-sizing: border-box;
}

.student-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.student-header h3 {
    margin: 0;
    font-size: 1.75rem;
    color: var(--text-primary);
}

.student-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-item {
    padding: 1rem;
    background: var(--light-bg);
    border-radius: var(--radius);
}

.info-item strong {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.info-item span {
    display: block;
    font-size: 1.125rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1600px) {
    .documents-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1200px) {
    .documents-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-direction: column;
        width: 100%;
    }

    .nav-menu a {
        width: 100%;
        text-align: center;
    }

    .dashboard-grid,
    .stats-grid,
    .budget-grid,
    .students-grid,
    .family-grid,
    .trips-grid,
    .meal-grid,
    .categories-grid,
    .documents-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 1rem 10px;
    }

    .module-section {
        padding: 1rem;
    }
}
