/* Child Sponsorship System - Main Stylesheet */
/* Theme: Royal Blue */

:root {
    --primary-color: #4169E1;
    --primary-dark: #2E4A9D;
    --primary-light: #6495ED;
    --secondary-color: #FFD700;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #F8F9FA;
    --dark-text: #212529;
    --border-color: #dee2e6;
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    color: var(--dark-text);
    background-color: var(--light-bg);
}

/* Login Page Styles */
.login-page {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    min-height: 100vh;
}

.login-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-card .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(65, 105, 225, 0.25);
}

.login-card .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 12px;
    font-weight: 600;
}

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

/* Main Layout */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.sidebar-header .logo-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.sidebar-menu {
    padding: 0;
    list-style: none;
    margin: 20px 0;
}

.sidebar-menu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left: 4px solid var(--secondary-color);
}

.sidebar-menu a i {
    width: 30px;
    font-size: 16px;
}

.user-profile {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    text-align: center;
    margin-top: auto;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--secondary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    transition: all 0.3s;
}

/* Top Header */
.top-header {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.top-header h5 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.notification-icon {
    position: relative;
    font-size: 20px;
    color: var(--primary-color);
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Content Area */
.content-area {
    padding: 30px;
}

/* Dashboard Cards */
.dashboard-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.stat-card.success::before {
    background: var(--success-color);
}

.stat-card.warning::before {
    background: var(--warning-color);
}

.stat-card.danger::before {
    background: var(--danger-color);
}

.stat-card.info::before {
    background: var(--info-color);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 15px;
}

.stat-icon.primary {
    background: rgba(65, 105, 225, 0.1);
    color: var(--primary-color);
}

.stat-icon.success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.stat-icon.warning {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
}

.stat-icon.danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark-text);
    margin: 10px 0;
}

.stat-label {
    color: #6c757d;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tables */
.table-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-header h5 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.table {
    margin-bottom: 0;
}

.table thead {
    background: var(--light-bg);
}

.table thead th {
    border-top: none;
    color: var(--primary-color);
    font-weight: 600;
    padding: 12px;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 12px;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(65, 105, 225, 0.05);
}

/* Badges */
.badge {
    padding: 6px 12px;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Buttons */
.btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s;
}

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

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

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

.btn-group-sm > .btn {
    padding: 4px 8px;
    font-size: 12px;
}

/* Forms */
.form-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-label {
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 8px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(65, 105, 225, 0.25);
}

.required {
    color: var(--danger-color);
}

/* Child Cards */
.child-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    height: 100%;
}

.child-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.child-photo {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.child-photo-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 64px;
}

.child-info {
    padding: 20px;
}

.child-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.child-details {
    font-size: 13px;
    color: #6c757d;
}

.child-details i {
    width: 20px;
    color: var(--primary-color);
}

/* Profile Photo */
.profile-photo-large {
    width: 150px;
    height: 150px;
    border-radius: 10px;
    object-fit: cover;
    border: 4px solid var(--primary-color);
}

.profile-photo-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    border: 4px solid var(--primary-color);
}

/* Search and Filters */
.search-filter-bar {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.search-box .form-control {
    padding-left: 45px;
}

/* Pagination */
.pagination {
    margin: 0;
}

.page-link {
    color: var(--primary-color);
    border-color: var(--border-color);
}

.page-link:hover {
    color: var(--primary-dark);
    background-color: var(--light-bg);
    border-color: var(--border-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    padding: 15px 20px;
}

/* Modal */
.modal-header {
    background: var(--primary-color);
    color: white;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 20px;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: #6c757d;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Print Styles */
@media print {
    .sidebar,
    .top-header,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    
    .sidebar.active {
        margin-left: 0;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .mobile-toggle {
        display: block !important;
        font-size: 24px;
        color: var(--primary-color);
        cursor: pointer;
    }
    
    .content-area {
        padding: 15px;
    }
    
    .table-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .table-responsive {
        font-size: 12px;
    }
    
    .stat-value {
        font-size: 24px;
    }
}

@media (max-width: 576px) {
    .top-header {
        padding: 10px 15px;
    }
    
    .header-actions {
        gap: 10px;
    }
    
    .dashboard-card {
        padding: 15px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

/* Loading Spinner */
.spinner-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 64px;
    color: var(--primary-light);
    margin-bottom: 20px;
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-upload-wrapper input[type=file] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
}

/* Status Indicators */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-dot.active {
    background: var(--success-color);
}

.status-dot.inactive {
    background: var(--danger-color);
}

.status-dot.pending {
    background: var(--warning-color);
}

/* Quick Action Buttons */
.quick-actions {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
}

.quick-action-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    cursor: pointer;
}

.quick-action-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}
