/* ===========================
   Love Score Application CSS
   Modern, Responsive, Animated
   =========================== */

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b9d;
    --primary-dark: #ff4081;
    --secondary-color: #4a90e2;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ===== Login Page ===== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
    animation: fadeIn 0.6s ease-out;
}

.login-box {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow-hover);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.heart-icon {
    font-size: 3rem;
    animation: pulse 2s infinite;
}

.logo h1 {
    font-size: 2rem;
    color: var(--primary-color);
}

.subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ===== Form Styles ===== */
.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
    resize: none; /* Khóa không cho kéo dãn */
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* ===== Toggle Switch ===== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 28px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #4caf50, #45a049);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(28px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

/* Hover effect */
.toggle-slider:hover {
    background-color: #b3b3b3;
}

.toggle-switch input:checked + .toggle-slider:hover {
    background: linear-gradient(135deg, #5cb85f, #4caf50);
}

/* Active/Inactive icons */
.toggle-slider:after {
    content: '✕';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
    transition: opacity 0.2s;
}

.toggle-switch input:checked + .toggle-slider:after {
    content: '✓';
    left: 8px;
    right: auto;
}

/* ===== Buttons ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-full-width {
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #3a7bc8;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-error {
    background: var(--error-color);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-loader {
    animation: spin 1s linear infinite;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
    border-radius: 6px;
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #d32f2f;
    transform: translateY(-2px);
}

/* ===== Message Box ===== */
.message-box {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.message-box.show {
    display: block;
}

.message-box.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.message-box.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
}

/* ===== Login Footer ===== */
.login-footer {
    margin-top: 30px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.demo-accounts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.demo-account {
    background: var(--bg-color);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: monospace;
    color: var(--text-light);
}

/* ===== Header ===== */
.header {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header .logo {
    gap: 10px;
}

.header .logo h1 {
    font-size: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    transition: var(--transition);
}

.avatar:hover {
    transform: scale(1.1);
}

.username {
    font-weight: 600;
    color: var(--text-color);
}

/* ===== Dropdown ===== */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    transition: var(--transition);
}

.dropdown-toggle:hover {
    transform: rotate(90deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow-hover);
    min-width: 200px;
    display: none;
    animation: fadeIn 0.3s ease-out;
    margin-top: 10px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.dropdown-menu a:hover {
    background: var(--bg-color);
}

.dropdown-menu a:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-menu a:last-child {
    border-radius: 0 0 8px 8px;
}

/* ===== Main Content ===== */
.main-content {
    padding: 30px 0;
    min-height: calc(100vh - 70px);
}

.dashboard-page .main-content,
.admin-page .main-content {
    background: var(--bg-color);
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    /* flex-wrap: wrap; */
    background: var(--card-bg);
    padding: 10px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    background: var(--bg-color);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

/* ===== Tab Content ===== */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

/* ===== Score Cards ===== */
.score-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.score-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    animation: scaleIn 0.4s ease-out;
}

.score-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.score-card .user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 15px;
    border: 4px solid var(--primary-color);
}

.score-card .user-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-color);
}

.score-card .score {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-card .score.positive {
    color: var(--success-color);
}

.score-card .score.negative {
    color: var(--error-color);
}

/* ===== Form Card ===== */
.form-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease-out;
}

.form-card h2 {
    margin-bottom: 20px;
    color: var(--text-color);
}

/* ===== History ===== */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.history-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.history-filters select,
.history-filters input {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    animation: slideIn 0.3s ease-out;
}

.history-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-hover);
}

.history-item .history-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.history-item .history-info {
    flex: 1;
}

.history-item .history-name {
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 5px;
}

.history-item .history-reason {
    color: var(--text-light);
    font-size: 0.95rem;
}

.history-item .history-date {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 5px;
}

.history-item .history-points {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 8px;
}
.history-points.positive,
.history-item .history-points.positive {
    color: var(--success-color);
    background: rgba(76, 175, 80, 0.1);
}

.history-points.negative,
.history-item .history-points.negative {
    color: var(--error-color);
    background: rgba(244, 67, 54, 0.1);
}

.history-points-mobile {
    display: none;
}

/* ===== Rewards/Penalties Grid ===== */
.rewards-section,
.penalties-section {
    margin-bottom: 40px;
}

.rewards-section h3,
.penalties-section h3 {
    margin-bottom: 20px;
    color: var(--text-color);
}

.rewards-grid,
.penalties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.reward-card,
.penalty-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    animation: scaleIn 0.3s ease-out;
}

.reward-card:hover,
.penalty-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.reward-card {
    border-left: 4px solid var(--success-color);
}

.penalty-card {
    border-left: 4px solid var(--error-color);
}

.reward-card .icon,
.penalty-card .icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
    animation: bounce 2s infinite;
}

.reward-card .points,
.penalty-card .points {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.reward-card .points {
    color: var(--success-color);
}

.penalty-card .points {
    color: var(--error-color);
}

.reward-card .reason,
.penalty-card .reason {
    color: var(--text-color);
    font-size: 0.95rem;
}

/* ===== Chart Container ===== */
.chart-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.chart-container canvas {
    max-height: 400px;
}

/* ===== Stats Cards ===== */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    animation: fadeIn 0.4s ease-out;
}

.stat-card h3 {
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 1.1rem;
}

/* ===== Admin Rule Cards ===== */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.rule-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
    position: relative;
    overflow: hidden;
}

.rule-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rule-card:hover::before {
    opacity: 1;
}

.rule-card.inactive {
    opacity: 0.6;
    border-left-color: #999;
}

.rule-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.rule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.rule-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.rule-points {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.03);
}

.rule-points.positive {
    color: var(--success-color);
    background: rgba(76, 175, 80, 0.1);
}

.rule-points.negative {
    color: var(--error-color);
    background: rgba(244, 67, 54, 0.1);
}

.rule-body {
    margin-bottom: 15px;
}

.rule-reason {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 10px;
    min-height: 40px;
    line-height: 1.5;
    font-weight: 500;
}

.rule-meta {
    font-size: 0.85rem;
    color: #999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-inactive {
    background: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
}

.rule-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.rule-actions .btn {
    flex: 1;
    font-size: 0.875rem;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.rule-actions .btn-secondary {
    background: #5a67d8;
}

.rule-actions .btn-secondary:hover {
    background: #4c51bf;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(90, 103, 216, 0.3);
}

.rule-actions .btn-danger:hover {
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.rules-section {
    margin-bottom: 30px;
}

.rules-section h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: scaleIn 0.3s ease-out;
    box-shadow: var(--shadow-hover);
}

.modal-content.large {
    max-width: 800px;
}

.modal-content .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.modal-content .close:hover {
    color: var(--error-color);
    transform: rotate(90deg);
}

.modal-content h3 {
    margin-bottom: 20px;
    color: var(--text-color);
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

/* ===== Avatar Preview ===== */
.avatar-preview {
    margin: 20px 0;
    text-align: center;
}

.avatar-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
}

/* ===== Month Selector ===== */
.month-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.month-selector h2 {
    color: var(--text-color);
}

/* ===== Month Picker ===== */
.month-picker {
    display: inline-flex;
    align-items: center;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.month-picker:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.15);
}

.month-picker-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 12px 16px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    min-width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.month-picker-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: scale(1.05);
}

.month-picker-btn:active {
    transform: scale(0.95);
}

.month-picker-display {
    padding: 0 20px;
    min-width: 120px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.month-picker-display:hover {
    background: var(--bg-color);
}

.month-picker-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.month-picker-text::before {
    content: '📅';
    font-size: 1.2rem;
}

/* ===== Users List (Admin) ===== */
.users-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.user-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    animation: scaleIn 0.3s ease-out;
}

.user-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.user-card .user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 15px;
    border: 3px solid var(--primary-color);
}

.user-card .user-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.user-card .user-username {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.user-card .user-role {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 10px;
}

.user-card .user-role.admin {
    background: var(--warning-color);
    color: white;
}

.user-card .user-role.user {
    background: var(--secondary-color);
    color: white;
}

/* ===== Monthly Activity Stats ===== */
.monthly-activity-stats {
    margin-bottom: 30px;
}

.monthly-activity-stats table {
    width: 100%;
}

.monthly-activity-stats td {
    padding: 8px 0;
}

.stats-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

/* ===== Activity List ===== */
.activity-filters {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.filter-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-row select,
.filter-row input {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    flex: 1;
    min-width: 150px;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 15px;
    align-items: center;
    transition: var(--transition);
    animation: slideIn 0.3s ease-out;
}

.activity-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-hover);
}

.activity-item .activity-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.activity-item .activity-details {
    flex: 1;
}

.activity-item .activity-user {
    font-weight: 700;
    color: var(--text-color);
}

.activity-item .activity-action {
    display: inline-block;
    padding: 5px 12px;
    background: var(--bg-color);
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 5px 0;
    color: var(--text-color);
    font-weight: 600;
    transition: var(--transition);
}

/* Action badges with colors */
.activity-item .activity-action.auth {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.activity-item .activity-action.points {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.activity-item .activity-action.view {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.activity-item .activity-action.admin {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.activity-item .activity-action.default {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

.activity-item .activity-description {
    color: var(--text-light);
    font-size: 0.9rem;
}

.activity-item .activity-meta {
    text-align: right;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination button {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    color: var(--text-color);
}

.pagination button:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: var(--text-light);
}

.pagination span {
    color: var(--text-color);
    font-weight: bold;
    padding: 8px;
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.stats-grid .stat-card {
    min-height: 300px;
}

/* ===== Points Stats ===== */
.points-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.points-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.points-header .month-selector {
    margin: 0;
}

/* ===== User Points History ===== */
.user-points-history {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    margin-top: 30px;
}

.user-points-history h3 {
    margin-bottom: 15px;
}

.user-points-history select {
    width: 100%;
    max-width: 400px;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 20px;
}

#userPointsHistory {
    margin-top: 20px;
}

/* ===== Most Active Users ===== */
#mostActiveUsers {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.active-user-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 8px;
    transition: var(--transition);
}

.active-user-item:hover {
    background: var(--border-color);
    transform: translateX(5px);
}

.active-user-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.active-user-item .info {
    flex: 1;
}

.active-user-item .name {
    font-weight: 700;
    color: var(--text-color);
}

.active-user-item .count {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .header {
        padding: 0;
    }
    

    .header-content {
        flex-direction: row;
        justify-content: space-between;
        gap: 15px;
    }

    .logo {
        margin: 0;
    }

    .logo-text {
        display: none;
    }

    .main-content {
        padding-top: 15px;
    }

    .tabs {
        margin-bottom: 15px;
    }

    .score-cards {
        grid-template-columns: 1fr;
    }

    .score-card {
        padding-top: 15px;
        padding-bottom: 15px;
    }

    .score-card .user-avatar {
        margin: 0;
    }

    .score-card .user-name {
        margin: 0;
    }

    .score-card .score {
        /* font-size: 2rem; */
        line-height: 3rem;
    }

    .form-card {
        padding: 15px;
    }

    .history-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-filters {
        width: 100%;
        flex-direction: column;
    }

    .history-filters select,
    .history-filters button {
        width: 100%;
    }
    
    .history-filters .month-picker {
        width: 100%;
        justify-content: space-between;
    }
    
    .month-picker-display {
        flex: 1;
        min-width: auto;
    }
    
    .month-picker-btn {
        min-width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .history-name,
    .history-date {
        margin: 0 !important;
    }

    .history-name {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .history-points {
        display: none;
    }
    
    .history-points-mobile {
        display: block;
        font-size: 1.2rem !important;
        font-weight: 800 !important;
        padding: 0 4px !important;
        border-radius: 8px !important;
    }

    .rewards-grid,
    .penalties-grid {
        grid-template-columns: 1fr;
    }

    .reward-card,
    .penalty-card {
        display: flex;
        align-items: center;
        gap: 15px;
        text-align: left;
        padding: 15px;
    }

    .reward-card .icon,
    .penalty-card .icon {
        font-size: 2rem;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .reward-card .points,
    .penalty-card .points {
        font-size: 1.2rem;
        margin-bottom: 0;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .reward-card .reason,
    .penalty-card .reason {
        font-size: 0.9rem;
        flex: 1;
        text-align: left;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-row select,
    .filter-row input {
        width: 100%;
    }

    .activity-item {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .activity-item .activity-meta {
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-section {
        padding: 15px;
    }
    
    .stats-section h3 {
        font-size: 1rem;
    }

    .modal-actions {
        flex-direction: row;
        justify-content: space-between;
    }

    .modal-actions button {
        flex: 1;
        min-width: 100px;
    }
}

/* ===== Loading Spinner ===== */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.5rem;
    color: var(--text-light);
}

.loading::after {
    content: '⏳';
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--text-color);
}

.empty-state p {
    color: var(--text-light);
}

/* =============================================
   TODO LIST STYLES
   ============================================= */

/* Todo Container */
.todos-container {
    animation: fadeIn 0.5s ease;
}

.todos-header {
    text-align: center;
    margin-bottom: 30px;
}

.todos-header h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* Todo Stats */
.todo-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.todo-stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    color: white;
    position: relative;
    overflow: hidden;
}

.todo-stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transition: var(--transition);
}

.todo-stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.todo-stat-card:hover::before {
    top: -30%;
    right: -30%;
}

.todo-stat-icon {
    font-size: 2.5rem;
    opacity: 0.9;
}

.todo-stat-content {
    flex: 1;
}

.todo-stat-value {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 5px;
}

.todo-stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Todo Filters */
/* Add Todo Form */
.add-todo-form {
    background: var(--card-bg);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.add-todo-form h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.char-count {
    display: block;
    text-align: right;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Todo List */
.todo-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Todo Item */
.todo-item {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
}

.todo-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-hover);
}

.todo-item.todo-completed {
    opacity: 0.7;
    border-left-color: var(--success-color);
}

.todo-main {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.todo-checkbox {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.todo-check-icon {
    display: inline-block;
    transition: var(--transition);
}

.todo-pending-icon {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.todo-content {
    flex: 1;
    min-width: 0;
}

.todo-description {
    font-size: 1.05rem;
    color: var(--text-color);
    margin-bottom: 10px;
    word-wrap: break-word;
}

.todo-strikethrough {
    text-decoration: line-through;
    color: var(--text-light);
}

.todo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.todo-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.todo-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.todo-assigned {
    color: var(--primary-color);
}

.todo-created {
    color: var(--secondary-color);
}

.todo-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.todo-completed-date {
    color: var(--success-color);
    font-weight: 500;
}

/* Todo Actions */
.todo-actions {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-shrink: 0;
}

.btn-icon {
    background: white;
    border: 2px solid #ddd;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-icon:active {
    transform: scale(0.95);
}

.btn-success {
    border-color: var(--success-color);
}

.btn-success:hover {
    background: var(--success-color);
    border-color: var(--success-color);
}

.btn-warning {
    border-color: var(--warning-color);
}

.btn-warning:hover {
    background: var(--warning-color);
    border-color: var(--warning-color);
}

.btn-danger {
    border-color: var(--error-color);
}

.btn-danger:hover {
    background: var(--error-color);
    border-color: var(--error-color);
}

.todo-status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
}

.badge-success {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success-color);
    border: 2px solid var(--success-color);
}

.badge-pending {
    background: rgba(255, 152, 0, 0.15);
    color: var(--warning-color);
    border: 2px solid var(--warning-color);
}

/* Responsive Todos */
@media (max-width: 768px) {
    .todo-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .todo-stat-card {
        padding: 12px;
        gap: 10px;
    }
    
    .todo-stat-icon {
        font-size: 1.8rem;
    }
    
    .todo-stat-value {
        font-size: 1.5rem;
    }
    
    .todo-stat-label {
        font-size: 0.75rem;
    }
    
    .add-todo-form {
        padding: 15px;
    }
    
    .add-todo-form h3 {
        font-size: 1.1rem;
    }
    
    #todoPartnerInfo {
        padding: 10px !important;
        font-size: 0.95rem !important;
    }
    
    #todoPartnerInfo span:first-child {
        font-size: 1.2rem !important;
    }
    
    .todo-item {
        padding: 12px;
    }
    
    .todo-main {
        gap: 10px;
    }
    
    .todo-checkbox {
        font-size: 1.2rem;
    }
    
    .todo-description {
        font-size: 0.95rem;
    }
    
    .todo-meta {
        flex-direction: column;
        gap: 6px;
        font-size: 0.85rem;
    }
    
    .todo-actions {
        margin-top: 10px;
        width: 100%;
        justify-content: flex-end;
        gap: 8px;
    }
    
    .btn-icon {
        font-size: 1.1rem;
        width: 36px;
        height: 36px;
        padding: 6px;
    }
    
    .todo-status-badge {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .todo-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .todo-stat-card {
        padding: 10px;
        gap: 8px;
    }
    
    .todo-stat-icon {
        font-size: 1.5rem;
    }
    
    .todo-stat-value {
        font-size: 1.3rem;
    }
    
    .todo-stat-label {
        font-size: 0.7rem;
    }
    
    .filter-btn {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
    
    .todo-item {
        padding: 10px;
    }
    
    .todo-main {
        flex-wrap: wrap;
    }
    
    .todo-content {
        width: 100%;
    }
    
    .todo-actions {
        width: 100%;
        margin-top: 8px;
        border-top: 1px solid #eee;
        padding-top: 8px;
    }
}

/* ===== Custom Confirm Modal ===== */
.custom-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-confirm-overlay.show {
    opacity: 1;
}

.custom-confirm-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    min-width: 320px;
    max-width: 450px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.custom-confirm-overlay.show .custom-confirm-modal {
    transform: scale(1);
}

.custom-confirm-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 24px;
    border-bottom: none;
}

.custom-confirm-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.custom-confirm-body {
    padding: 30px 24px;
    color: #333;
}

.custom-confirm-body p {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.6;
}

.custom-confirm-footer {
    padding: 16px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.btn-custom-cancel,
.btn-custom-confirm {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 90px;
}

.btn-custom-cancel {
    background: #e9ecef;
    color: #495057;
}

.btn-custom-cancel:hover {
    background: #dee2e6;
    transform: translateY(-2px);
}

.btn-custom-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-custom-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

/* ===== Custom Toast Notification ===== */
.custom-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    z-index: 10001;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.custom-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.custom-toast.custom-toast-success {
    border-left: 4px solid #4caf50;
}

.custom-toast.custom-toast-error {
    border-left: 4px solid #f44336;
}

.custom-toast.custom-toast-info {
    border-left: 4px solid #2196f3;
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-message {
    color: #333;
    font-size: 0.95rem;
    line-height: 1.4;
}

@media (max-width: 480px) {
    .custom-confirm-modal {
        min-width: 280px;
    }
    
    .custom-confirm-header {
        padding: 16px 20px;
    }
    
    .custom-confirm-header h3 {
        font-size: 1.1rem;
    }
    
    .custom-confirm-body {
        padding: 24px 20px;
    }
    
    .custom-confirm-body p {
        font-size: 0.95rem;
    }
    
    .custom-confirm-footer {
        padding: 12px 20px;
    }
    
    .btn-custom-cancel,
    .btn-custom-confirm {
        padding: 8px 16px;
        font-size: 0.9rem;
        min-width: 70px;
    }
    
    .custom-toast {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
}


