/* Admin Panel CSS */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Admin Header */
.admin-header {
    background: linear-gradient(135deg, #2E7D32 0%, #388E3C 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.admin-logo i {
    font-size: 1.6rem;
    color: #CDDC39;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
}

.current-page {
    color: #CDDC39;
    font-weight: 600;
}

/* Main Content */
.admin-main {
    padding: 2rem 0;
}

/* Stats Section */
.stats-section {
    margin-bottom: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    background: linear-gradient(45deg, #4CAF50, #8BC34A);
}

.stat-icon.offline {
    background: linear-gradient(45deg, #FF9800, #FFB74D);
}

.stat-icon.online {
    background: linear-gradient(45deg, #2196F3, #64B5F6);
}

.stat-icon.recent {
    background: linear-gradient(45deg, #9C27B0, #BA68C8);
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #2E7D32;
    margin-bottom: 0.3rem;
}

.stat-content p {
    color: #666;
    font-weight: 500;
}

/* Filter Section */
.filter-section {
    margin-bottom: 2rem;
}

.filter-header {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.filter-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2E7D32;
    margin-bottom: 1.5rem;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.search-box input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #4CAF50;
}

.filter-select {
    padding: 0.8rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #4CAF50;
}

.refresh-btn,
.export-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.2rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-btn {
    background: #f0f0f0;
    color: #333;
}

.refresh-btn:hover {
    background: #e0e0e0;
}

.export-btn {
    background: linear-gradient(45deg, #4CAF50, #8BC34A);
    color: white;
}

.export-btn:hover {
    background: linear-gradient(45deg, #45a049, #7cb342);
    transform: translateY(-2px);
}

/* Table Section */
.table-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.table-info {
    font-weight: 600;
    color: #2E7D32;
}

.table-pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-btn {
    width: 35px;
    height: 35px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#pageInfo {
    font-weight: 600;
    color: #666;
}

.table-wrapper {
    overflow-x: auto;
}

.participants-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.participants-table th,
.participants-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.participants-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2E7D32;
    position: sticky;
    top: 0;
    z-index: 1;
}

.participants-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease;
}

.participants-table th.sortable:hover {
    background: #e9ecef;
}

.participants-table th.sortable i {
    margin-left: 0.5rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.participants-table th.sortable.sorted i {
    opacity: 1;
    color: #4CAF50;
}

.participants-table tbody tr {
    transition: background-color 0.3s ease;
}

.participants-table tbody tr:hover {
    background: rgba(76, 175, 80, 0.05);
}

.participation-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.participation-badge.offline {
    background: rgba(255, 152, 0, 0.1);
    color: #FF9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.participation-badge.online {
    background: rgba(33, 150, 243, 0.1);
    color: #2196F3;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

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

/* Loading and Empty States */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.loading-state i {
    font-size: 3rem;
    color: #4CAF50;
    margin-bottom: 1rem;
}

.loading-state p {
    font-size: 1.1rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.empty-state i {
    font-size: 4rem;
    color: #ccc;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #999;
}

.empty-state.hidden {
    display: none;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.modal-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2E7D32;
}

.modal-close {
    width: 35px;
    height: 35px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background: #e0e0e0;
}

.modal-body {
    padding: 2rem;
}

.participant-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row label {
    font-weight: 600;
    color: #666;
    min-width: 100px;
}

.participant-id {
    font-family: monospace;
    background: #f8f9fa;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.delete-warning {
    text-align: center;
}

.delete-warning i {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 1rem;
}

.delete-participant-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2E7D32;
    margin: 1rem 0;
}

.warning-text {
    color: #dc3545;
    font-weight: 500;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

/* Toast Message */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    padding: 1rem 1.5rem;
    z-index: 2000;
    min-width: 300px;
    animation: toastSlideIn 0.3s ease;
}

.toast.hidden {
    display: none;
}

.toast.success {
    border-left: 4px solid #4CAF50;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

.toast.info {
    border-left: 4px solid #2196F3;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.toast-icon {
    font-size: 1.2rem;
}

.toast.success .toast-icon {
    color: #4CAF50;
}

.toast.error .toast-icon {
    color: #dc3545;
}

.toast.info .toast-icon {
    color: #2196F3;
}

.toast-message {
    font-weight: 500;
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        text-align: center;
    }
    
    .participants-table {
        font-size: 0.85rem;
    }
    
    .participants-table th,
    .participants-table td {
        padding: 0.8rem 0.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem 1.5rem;
    }
    
    .toast {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .admin-main {
        padding: 1rem 0;
    }
    
    .filter-header {
        padding: 1.5rem;
    }
    
    .participants-table th,
    .participants-table td {
        padding: 0.6rem 0.3rem;
        font-size: 0.8rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}