/* Modern Professional Styles */

:root {
    --primary-color: #4f46e5;
    --success-color: #10b981;
    --info-color: #3b82f6;
    --danger-color: #ef4444;
    --dark-bg: #0f172a;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.modern-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
}

.container {
    max-width: 1400px;
}

/* Modern Header */
.modern-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.header-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
}

.header-title i {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Modern Card */
.modern-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

/* Section Title */
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
}

.section-title i {
    color: #667eea;
}

/* Toast Styling */
.toast-container {
    z-index: 9999;
}

.toast {
    min-width: 300px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.toast .toast-body {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Modern Input Fields */
.modern-input {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.875rem 1.125rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.modern-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.modern-input.is-invalid {
    border-color: #ef4444;
}

.modern-input.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* Modern Buttons */
.btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.675rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-outline-light {
    border: 2px solid white;
    color: white;
    background: transparent;
}

.btn-outline-light:hover {
    background: white;
    color: #667eea;
    transform: translateY(-2px);
}

.btn-outline-secondary {
    border: 2px solid #6b7280;
    color: #6b7280;
}

.btn-outline-secondary:hover {
    background: #6b7280;
    color: white;
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Modern Statistics Cards */
.modern-stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.modern-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.modern-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.stat-primary::before {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.stat-success::before {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.stat-info::before {
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.modern-stat-card .stat-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 2rem;
    color: white;
    flex-shrink: 0;
}

.stat-primary .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-success .stat-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-info .stat-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.modern-stat-card .stat-details h3 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    color: #1e293b;
    line-height: 1;
}

.modern-stat-card .stat-details p {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0.5rem 0 0 0;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* DataTables Styling */
.modern-table {
    margin-bottom: 0;
    width: 100% !important;
}

.modern-table thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    padding: 1rem 0.75rem;
    border-bottom: 2px solid #e2e8f0;
    vertical-align: middle;
    white-space: nowrap;
}

.modern-table tbody td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    color: #334155;
    font-size: 0.95rem;
    border-bottom: 1px solid #f1f5f9;
}

.modern-table tbody tr {
    transition: all 0.2s ease;
}

.modern-table tbody tr:hover {
    background: #f8fafc;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dataTables_wrapper {
    width: 100%;
}

.dataTables_wrapper .row {
    margin: 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    padding: 0.5rem 0;
}

.dataTables_wrapper .dataTables_filter input {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.5rem 1rem;
    margin-left: 0.5rem;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #667eea;
    outline: none;
}

.dataTables_wrapper .dataTables_length select {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    margin: 0 0.5rem;
}

.dataTables_wrapper .dataTables_info {
    color: #64748b;
    font-weight: 500;
    padding: 0.75rem 0;
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: 0.75rem;
}

/* Badges */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
}

.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.bg-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%) !important;
}

.points-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    display: inline-block;
}

/* RFID Code Styling */
.rfid-code {
    background: #f1f5f9;
    color: #667eea;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    border: 1px solid #e2e8f0;
}

/* Status Icon Styling */
.status-icon {
    font-size: 1.5rem;
    cursor: pointer;
}

.status-icon.text-success {
    color: #10b981 !important;
}

.status-icon.text-secondary {
    color: #6b7280 !important;
}

/* Code (general) */
code {
    background: #f1f5f9;
    color: #667eea;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    border: 1px solid #e2e8f0;
}

/* Modal Styling */
.modal-backdrop {
    z-index: 1040 !important;
    background-color: rgba(0, 0, 0, 0.6);
}

.modal {
    z-index: 1050 !important;
}

.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.modal-header.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 20px 20px 0 0;
    padding: 1rem 1.5rem;
}

.modal-header .modal-title {
    font-weight: 700;
    font-size: 1.25rem;
}

.modal-body {
    padding: 1.5rem;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* Form Labels */
.form-label {
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Status Toggle Switch */
.form-check-input {
    width: 3rem;
    height: 1.5rem;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #10b981;
    border-color: #10b981;
}

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

.form-check-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #475569;
    cursor: pointer;
}

/* Invalid Feedback */
.invalid-feedback {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-title {
        font-size: 1.75rem;
    }

    .modern-header {
        padding: 1.5rem;
    }

    .modern-stat-card {
        padding: 1.5rem;
    }

    .modern-stat-card .stat-icon {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
    }

    .modern-stat-card .stat-details h3 {
        font-size: 2rem;
    }

    /* Mobile Modal Optimizations */
    .modal-header {
        padding: 0.5rem 0.75rem !important;
    }

    .modal-header .modal-title {
        font-size: 0.95rem !important;
    }

    .modal-body {
        padding: 0.75rem !important;
        max-height: calc(100vh - 120px) !important;
    }

    .modal-footer {
        padding: 0.5rem 0.75rem !important;
    }

    .form-label {
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
    }

    .form-control,
    .form-select {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }

    .btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .modern-input {
        border-radius: 8px !important;
    }

    .row.g-3 {
        --bs-gutter-y: 0.5rem;
    }

    h6 {
        font-size: 0.9rem;
        margin-bottom: 0.4rem !important;
        margin-top: 0.5rem !important;
    }

    small {
        font-size: 0.7rem;
    }

    textarea.form-control {
        min-height: 60px;
    }

    .modern-table thead th {
        font-size: 0.65rem;
        padding: 0.75rem 0.5rem;
    }

    .modern-table tbody td {
        font-size: 0.85rem;
        padding: 0.75rem 0.5rem;
    }

    .btn-sm {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }

    .rfid-code {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        margin-bottom: 1rem;
    }

    * {
        transition: background-color 0.2s ease, border-color 0.2s ease;
    }

    html {
        scroll-behavior: smooth;
    }

    /* SweetAlert2 Custom Theme */
    .swal2-popup {
        border-radius: 20px;
        padding: 2rem;
    }

    .swal2-title {
        font-size: 1.75rem;
        font-weight: 700;
    }

    .swal2-styled.swal2-confirm {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        border-radius: 12px;
        padding: 0.675rem 2rem;
        font-weight: 600;
    }

    .swal2-styled.swal2-cancel {
        background: #6b7280 !important;
        border-radius: 12px;
        padding: 0.675rem 2rem;
        font-weight: 600;
    }
}

.no-users {
    text-align: center;
    padding: 3rem !important;
    color: var(--text-secondary);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

.modal-small {
    max-width: 500px;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    background: #f9fafb;
}

.game-points-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 8px;
}

.game-points-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-points-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.user-info {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-weight: 600;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    display: none;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideInRight 0.3s ease;
    z-index: 2000;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.show {
    display: flex;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-box {
        width: 100%;
        max-width: none;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    .user-table {
        font-size: 0.875rem;
    }

    .user-table th,
    .user-table td {
        padding: 0.75rem 0.5rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .game-points-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}