/**
 * Impact Savings Village Banking System
 * Main Stylesheet
 */

:root {
    --primary-color: #1F4E79;
    --secondary-color: #2E75B6;
    --accent-color: #5B9BD5;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    color: #333;
    line-height: 1.6;
}

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

.login-box {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 450px;
    padding: 40px;
}

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

.login-logo h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
}

.login-logo p {
    color: #666;
    font-size: 0.9rem;
}

.form-floating {
    margin-bottom: 15px;
}

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

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

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

.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-color);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s;
    z-index: 1000;
}

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

.sidebar-header h3 {
    font-size: 1.2rem;
    margin: 0;
}

.sidebar-header p {
    font-size: 0.75rem;
    opacity: 0.8;
    margin: 5px 0 0;
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu li {
    margin: 5px 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.9);
    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(--accent-color);
}

.sidebar-menu i {
    width: 25px;
    margin-right: 10px;
    font-size: 1.1rem;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    position: absolute;
    bottom: 0;
    width: 100%;
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px;
    transition: all 0.3s;
}

.top-bar {
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-title h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 0;
}

.page-title p {
    color: #666;
    font-size: 0.85rem;
    margin: 5px 0 0;
}

.top-actions {
    display: flex;
    gap: 10px;
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: none;
    margin-bottom: 20px;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #eee;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.card-body {
    padding: 20px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary {
    background: rgba(31, 78, 121, 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.info {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info-color);
}

.stat-details h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #333;
}

.stat-details p {
    color: #666;
    font-size: 0.85rem;
    margin: 5px 0 0;
}

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

.table {
    width: 100%;
    margin-bottom: 0;
}

.table th {
    background: #f8f9fa;
    color: var(--primary-color);
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

.badge {
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Status Badges */
.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-verified,
.badge-approved,
.badge-active,
.badge-paid {
    background: #d4edda;
    color: #155724;
}

.badge-rejected,
.badge-defaulted {
    background: #f8d7da;
    color: #721c24;
}

/* Forms */
.form-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 12px 15px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(91, 155, 213, 0.25);
}

/* Signature Pad */
.signature-pad-container {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    background: #fafafa;
}

.signature-pad {
    border: 1px solid #ccc;
    border-radius: 5px;
    background: white;
    cursor: crosshair;
    touch-action: none;
}

.signature-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Payment Screenshot */
.payment-screenshot {
    max-width: 300px;
    border-radius: 8px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: transform 0.2s;
}

.payment-screenshot:hover {
    transform: scale(1.05);
}

/* Modal Image Preview */
.modal-image-preview {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
}

/* Application Form */
.application-form {
    max-width: 900px;
    margin: 0 auto;
}

.form-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.form-section h4 {
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

/* Member Dashboard */
.dashboard-welcome {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.dashboard-welcome h3 {
    margin: 0 0 10px;
}

.dashboard-welcome p {
    opacity: 0.9;
    margin: 0;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.quick-action-btn {
    background: white;
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.quick-action-btn:hover {
    border-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    color: var(--primary-color);
}

.quick-action-btn i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: block;
}

/* Payment History */
.payment-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.payment-item:last-child {
    border-bottom: none;
}

.payment-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

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

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

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

.payment-details {
    flex: 1;
}

.payment-details h5 {
    margin: 0 0 5px;
    font-size: 1rem;
}

.payment-details p {
    margin: 0;
    color: #666;
    font-size: 0.85rem;
}

.payment-amount {
    text-align: right;
}

.payment-amount h4 {
    margin: 0;
    color: var(--primary-color);
}

/* Verification Actions */
.verification-actions {
    display: flex;
    gap: 10px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }
    
    .sidebar .sidebar-menu span,
    .sidebar .user-details,
    .sidebar-header p {
        display: none;
    }
    
    .main-content {
        margin-left: var(--sidebar-collapsed);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

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

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px 20px;
}

.empty-state i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state h4 {
    color: #666;
    margin-bottom: 10px;
}

.empty-state p {
    color: #999;
}
