/**
 * Who Drop Alert CSS
 * สไตล์สำหรับหน้าแจ้งเตือนไอเทมแรร์
 */

/* === Container === */
.whodropalert-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* === Header === */
.whodropalert-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.1));
    border-radius: 20px;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.whodropalert-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.whodropalert-header p {
    color: #94a3b8;
    font-size: 1.1rem;
}

/* === Filter Section === */
.filter-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.filter-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 500;
}

.filter-select {
    padding: 0.875rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-select:focus {
    outline: none;
    border-color: #f59e0b;
}

.filter-select option {
    background: #1e293b;
    color: white;
}

.refresh-btn {
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.auto-refresh-toggle {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 0.9rem;
}

.auto-refresh-toggle input {
    margin-right: 0.5rem;
    accent-color: #f59e0b;
}

.test-btn {
    margin-left: 1rem;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.test-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.4);
}

/* === Stats Summary === */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(245, 158, 11, 0.3);
}

.stat-card.total {
    border-left: 4px solid #f59e0b;
}

.stat-card.latest {
    border-left: 4px solid #10b981;
}

.stat-card.updated {
    border-left: 4px solid #3b82f6;
}

.stat-icon {
    font-size: 2rem;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.stat-label {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* === Drop List === */
.drop-list-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    color: white;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.drop-list-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.drop-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.drop-table thead {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.drop-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
}

.drop-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.drop-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.drop-table tbody tr.new-drop {
    background: rgba(245, 158, 11, 0.1);
    animation: newDropPulse 2s ease-in-out;
}

@keyframes newDropPulse {

    0%,
    100% {
        background: rgba(245, 158, 11, 0.1);
    }

    50% {
        background: rgba(245, 158, 11, 0.2);
    }
}

/* === Pagination === */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.page-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.2);
}

.page-info {
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
}

.page-info span {
    color: #fbbf24;
    font-weight: 700;
}

.drop-table td {
    padding: 0.875rem 1rem;
    color: #e2e8f0;
    font-size: 0.9rem;
}

.time-cell {
    font-family: 'Courier New', monospace;
    color: #f59e0b;
    font-weight: 600;
}

.item-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.5);
    border-radius: 20px;
    font-size: 0.85rem;
    color: #a78bfa;
    font-weight: 600;
}

/* Item Icon Sprite */
.item-icon-sprite {
    display: inline-block;
    width: 34px;
    height: 34px;
    background-size: auto;
    background-repeat: no-repeat;
    vertical-align: middle;
    margin-right: 0.5rem;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.item-icon-default {
    display: inline-block;
    width: 34px;
    height: 34px;
    line-height: 34px;
    text-align: center;
    font-size: 1.25rem;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.item-name-text {
    display: inline-block;
    vertical-align: middle;
    color: #a78bfa;
    font-weight: 600;
    font-size: 0.9rem;
}

.drop-link.item-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.drop-link.item-link:hover .item-name-text {
    color: #c4b5fd;
}

.drop-link.item-link:hover .item-icon-sprite {
    border-color: #a78bfa;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

/* === Item Color Classes === */

/* Spectrum Series - Gold/Yellow */
.item-spectrum {
    border-color: #fbbf24 !important;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.item-spectrum+.item-name-text,
.item-spectrum~.item-name-text {
    color: #fbbf24 !important;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

tr:has(.item-spectrum) {
    border-left: 3px solid #fbbf24;
}

/* Rare Weapons - Crimson (Guns, Wands, Shadow Series) */
.item-rare-weapon {
    border-color: #dc2626 !important;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
}

.item-rare-weapon+.item-name-text,
.item-rare-weapon~.item-name-text {
    color: #ef4444 !important;
    text-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

tr:has(.item-rare-weapon) {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.06), transparent) !important;
    border-left: 3px solid #dc2626;
}

/* Default */
.item-default {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.map-cell {
    color: #10b981;
}

.player-cell {
    color: #3b82f6;
    font-weight: 500;
}

.source-cell {
    color: #94a3b8;
    font-size: 0.85rem;
}

/* Drop Links */
.drop-link {
    text-decoration: none;
    transition: all 0.2s;
}

.drop-link:hover {
    transform: scale(1.02);
}

.drop-link.item-link .item-badge {
    cursor: pointer;
    transition: all 0.2s;
}

.drop-link.item-link:hover .item-badge {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.5), rgba(139, 92, 246, 0.3));
    border-color: #a78bfa;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.drop-link.source-link {
    color: #10b981;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
    display: inline-block;
}

.drop-link.source-link:hover {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

/* === Loading & States === */
.loading-state,
.empty-state,
.error-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #94a3b8;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(245, 158, 11, 0.2);
    border-top-color: #f59e0b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-state {
    color: #f87171;
}

/* === Tracked Items === */
.tracked-items-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
}

.tracked-items-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tracked-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.tracked-item .item-id {
    color: #64748b;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
}

.tracked-item .item-name {
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 500;
}

/* === Responsive === */
@media (max-width: 768px) {
    .whodropalert-header h1 {
        font-size: 1.75rem;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .refresh-btn {
        width: 100%;
        justify-content: center;
    }

    .stats-summary {
        grid-template-columns: 1fr;
    }

    .drop-table th,
    .drop-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* === New Drop Animations === */
/* Animation class - applied directly, no hidden state */
.fade-in-new {
    animation: fadeInSlide 0.5s ease-out, highlightNew 3s ease 0.3s;
}

@keyframes fadeInSlide {
    0% {
        opacity: 0;
        transform: translateY(-15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes highlightNew {
    0% {
        background: rgba(16, 185, 129, 0.25);
        box-shadow: inset 0 0 15px rgba(16, 185, 129, 0.3);
    }

    50% {
        background: rgba(16, 185, 129, 0.1);
    }

    100% {
        background: transparent;
        box-shadow: none;
    }
}

/* New drop row highlight */
.drop-table tbody tr.new-drop {
    border-left: 3px solid #10b981;
}

/* === Notification Popup === */
.new-drop-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    z-index: 9999;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.new-drop-notification.show {
    opacity: 1;
    transform: translateX(0);
}

/* Pulse animation for new items */
.drop-table tbody tr.new-drop td:first-child::before {
    content: '🆕';
    margin-right: 0.5rem;
    animation: pulse 1s ease infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}