/* 서버 메시지 스타일 */
.server-message {
    background-color: #FFF9E5;
    border-left: 4px solid var(--primary-color);
    padding: 0.8rem 1rem;
    margin: 1rem 0;
    color: var(--secondary-color);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 0 4px 4px 0;
    text-align: left;
}

/* 로딩 인디케이터 및 에러 알림 스타일 - 최적화 추가 */
.loading-state {
    position: relative;
}

.loading-state::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.total-points.loading {
    position: relative;
}

.total-points.loading::after {
    content: '\1F504'; /* 새로고침 아이콘 */
    font-size: 2rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1.5s linear infinite;
    z-index: 10;
}

.error-notification {
    background-color: #ffe5e5;
    border-left: 4px solid #ff5555;
    padding: 0.8rem 1rem;
    margin: 1rem 0;
    color: #ff3333;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 0 4px 4px 0;
    text-align: left;
    position: relative;
    padding-right: 30px;
}

.error-notification::after {
    content: '\2716'; /* X 아이콘 */
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

/* 캐시 알림 스타일 */
.cache-notice {
    background-color: #e5f5ff;
    border-left: 4px solid #0077cc;
    padding: 0.8rem 1rem;
    margin: 0.5rem 0 1.5rem;
    color: #0077cc;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 0 4px 4px 0;
    text-align: center;
}

/* 페이지네이션 스타일 - 최적화 추가 */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 10px;
    gap: 1rem;
}

.pagination-btn {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.pagination-btn:hover {
    background-color: var(--secondary-color);
    color: white;
}

.pagination-btn:disabled {
    background-color: #ddd;
    color: #999;
    cursor: not-allowed;
}

.page-info {
    font-weight: bold;
    color: var(--secondary-color);
    padding: 0 1rem;
}

.prev-btn::before {
    content: '\2190'; /* 왼쪽 화살표 */
    margin-right: 5px;
}

.next-btn::after {
    content: '\2192'; /* 오른쪽 화살표 */
    margin-left: 5px;
}

/* Total Smile Points page specific styles */

.points-section {
    padding: 5rem 0;
}

.section-description {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.points-counter {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    max-width: 800px;
    margin: 0 auto 4rem;
    text-align: center;
}

.counter-title {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.total-points {
    font-size: 4rem;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(139, 69, 19, 0.3);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.points-icon {
    margin-right: 15px;
    font-size: 3.5rem;
}

.counter-description {
    color: #777;
    margin-bottom: 1.5rem;
}

.stats-summary {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.stat-item {
    background-color: #f9f9f9;
    padding: 1rem;
    border-radius: 10px;
    min-width: 150px;
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #777;
    font-size: 0.9rem;
}

.last-updated {
    font-style: italic;
    color: #999;
    font-size: 0.9rem;
}

.refresh-text {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-top: 1rem;
}

.countdown {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 5px;
}

.stats-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.stats-title {
    color: var(--secondary-color);
    margin-bottom: 2rem;
    font-size: 1.8rem;
    text-align: center;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

.users-table th,
.users-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.users-table th {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    font-weight: bold;
}

.users-table tr:hover {
    background-color: #f5f5f5;
}

.user-id {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.points {
    font-weight: bold;
    text-align: right;
}

.points-visual {
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
    vertical-align: middle;
}

.no-users {
    text-align: center;
    padding: 2rem;
    color: #777;
    font-style: italic;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #777;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 209, 0, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.refresh-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    border: 2px solid var(--primary-color);
    cursor: pointer;
    margin-top: 1.5rem;
}

.refresh-btn:hover {
    background-color: transparent;
    color: var(--secondary-color);
}

.refresh-btn:disabled {
    background-color: #e5e5e5;
    border-color: #e5e5e5;
    color: #999;
    cursor: not-allowed;
}

.info-section {
    background-color: var(--secondary-color);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.info-container {
    max-width: 800px;
    margin: 0 auto;
}

.info-title {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.info-text {
    margin-bottom: 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    text-align: center;
}

.info-item {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 10px;
    transition: transform 0.3s;
}

.info-item:hover {
    transform: translateY(-10px);
}

.info-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.info-item-title {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: bold;
}

/* Media queries */
@media (max-width: 768px) {
    .coin-counter,
    .stats-container {
        padding: 1.5rem;
    }

    .total-coins {
        font-size: 3rem;
    }

    .coin-icon {
        font-size: 2.5rem;
    }

    .users-table th,
    .users-table td {
        padding: 8px;
        font-size: 0.9rem;
    }

    .user-id {
        max-width: 150px;
    }

    .stats-summary {
        gap: 1rem;
    }

    .stat-item {
        min-width: 120px;
        padding: 0.8rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}
