/* ================================================
   ระบบบริหารจัดการผู้รับธรรม - Main Stylesheet
   ================================================ */

/* === Google Fonts === */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

/* === Global Styles === */
* {
    font-family: 'Sarabun', sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.cursor-pointer {
    cursor: pointer;
}

/* === Login Page Styles === */
.login-title {
    font-size: 1.45rem;
}

.card {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.card-body {
    position: relative;
}

.input-group-text {
    border: 1px solid #dee2e6;
}

.form-control:focus,
.input-group-text:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

/* === Dashboard Styles === */
.sidebar {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    transition: all 0.3s;
    z-index: 1000;
}

.sidebar.collapsed {
    margin-left: -260px;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 20px;
    margin: 5px 10px;
    border-radius: 8px;
    transition: all 0.3s;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateX(5px);
}

.sidebar .nav-link i {
    margin-right: 10px;
    font-size: 1.1rem;
}

.main-content {
    margin-left: 260px;
    padding: 20px;
    transition: all 0.3s;
    min-height: 100vh;
    background: #f8f9fa;
}

.main-content.expanded {
    margin-left: 0;
}

.top-navbar {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    margin: -20px -20px 20px -20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.page-header h2 {
    color: #667eea;
    margin: 0;
}

.page-title-small {
    font-size: 18px;
}

/* === Card Styles === */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

.stat-card .icon.bg-primary {
    background: rgba(102, 126, 234, 0.1);
    color: white;
}

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

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

.stat-card .icon.bg-info {
    background: rgba(23, 162, 184, 0.1);
    color: white;
}

/* === Table Styles === */
.table-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px;
    font-weight: 500;
}

.table tbody tr {
    transition: all 0.3s;
}

.table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

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

/* === Button Styles === */
.btn {
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.875rem;
}

.btn-primary {
    background: #667eea;
    border-color: #667eea;
}

.btn-primary:hover {
    background: #5568d3;
    border-color: #5568d3;
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: #667eea;
    border-color: #667eea;
}

.btn-outline-primary:hover {
    background: #667eea;
    border-color: #667eea;
}

/* === Form Styles === */
.form-control,
.form-select {
    border-radius: 8px;
    padding: 10px 15px;
    border: 1px solid #dee2e6;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
}

/* === Modal Styles === */
.modal-content {
    border-radius: 10px;
    border: none;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px 10px 0 0;
}

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

/* === Badge Styles === */
.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
}

/* === Search Box === */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 40px;
}

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

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

/* === Animations === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* === Responsive === */
@media (max-width: 768px) {
    .sidebar {
        margin-left: -260px;
    }

    .sidebar.show {
        margin-left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .top-navbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* === Print Styles === */
@media print {
    .sidebar,
    .top-navbar,
    .btn,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }
}

/* === Toast Notification === */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
    font-weight: 500;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}
