/* Main color scheme - black background with rainbow accents */
:root {
    --main-bg-color: #121212;
    --secondary-bg-color: #1e1e1e;
    --accent-color: linear-gradient(90deg, #ff0066, #ff9900, #33cc33, #00ccff, #9933ff);
    --accent-light: linear-gradient(90deg, #ff5599, #ffbb33, #66dd66, #66ddff, #bb66ff);
    --text-color: #f0f0f0;
    --secondary-text-color: #cccccc;
    --border-color: #333333;
    --hover-bg-color: #2c2c2c;
    --completed-color: #666666;
    --completed-bg: #191919;
    --completed-hover-bg: #232323;
    --row-highlight-color: rgba(0, 204, 255, 0.15);
    
    /* Rainbow colors for various elements */
    --rainbow-1: #ff0066;
    --rainbow-2: #ff9900;
    --rainbow-3: #33cc33;
    --rainbow-4: #00ccff;
    --rainbow-5: #9933ff;
    
    /* Light rainbow colors */
    --rainbow-light-1: #ff5599;
    --rainbow-light-2: #ffbb33;
    --rainbow-light-3: #66dd66;
    --rainbow-light-4: #66ddff;
    --rainbow-light-5: #bb66ff;
}

/* Global styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--main-bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    color: var(--rainbow-4);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--rainbow-light-2);
    text-decoration: underline;
}

/* Header styles */
.header {
    background-color: var(--secondary-bg-color);
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.header h1 {
    margin: 0;
    font-size: 1.9rem;
    background: linear-gradient(to right, var(--rainbow-1), var(--rainbow-2), var(--rainbow-3), var(--rainbow-4), var(--rainbow-5));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 4px var(--rainbow-light-4);
    animation: rainbow-glow 10s linear infinite;
}

@keyframes rainbow-glow {
    0% {
        text-shadow: 0 0 4px var(--rainbow-light-1);
    }
    20% {
        text-shadow: 0 0 4px var(--rainbow-light-2);
    }
    40% {
        text-shadow: 0 0 4px var(--rainbow-light-3);
    }
    60% {
        text-shadow: 0 0 4px var(--rainbow-light-4);
    }
    80% {
        text-shadow: 0 0 4px var(--rainbow-light-5);
    }
    100% {
        text-shadow: 0 0 4px var(--rainbow-light-1);
    }
}

.header p {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}

/* Filter container */
.filter-container {
    position: relative;
    background-color: var(--secondary-bg-color);
    padding: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

/* Search box and clear button */
.search-box {
    display: flex;
    justify-content: center;
    margin: 0 auto;
    max-width: 600px;
    position: relative;
}

#searchInput {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 100%;
    background-color: var(--main-bg-color);
    color: var(--text-color);
    padding-right: 35px; /* Make room for the clear button */
}

#searchInput:focus {
    outline: none;
    border-color: var(--rainbow-3);
    box-shadow: 0 0 0 2px rgba(0, 204, 255, 0.25);
}

.search-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--secondary-text-color);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transition: all 0.2s;
}

.search-clear-btn:hover {
    background-color: rgba(0, 204, 255, 0.2);
    color: var(--rainbow-4);
}

/* Hide the clear button when input is empty (using JavaScript to toggle) */
.search-clear-btn.hidden {
    display: none;
}

/* Loading and error states */
.loading-container {
    text-align: center;
    padding: 2rem;
    color: var(--secondary-text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    position: relative;
    z-index: 10;
}

/* When loading container is visible, blur the table container */
.loading-container:not([style*="display: none"]) ~ .table-container {
    filter: blur(8px);
    transition: filter 0.3s ease;
    pointer-events: none;
}

.loading-spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--rainbow-3);
    border-right: 4px solid var(--rainbow-1);
    border-bottom: 4px solid var(--rainbow-5);
    border-left: 4px solid var(--rainbow-2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1.2s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
    margin: 0 auto 1.5rem;
}

.loading-container p {
    font-size: 1rem;
    margin-top: 1rem;
    max-width: 400px;
    animation: pulse 2s infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.error {
    color: #ff6b6b;
    font-weight: bold;
    padding: 1rem;
    background-color: rgba(255, 107, 107, 0.1);
    border-radius: 4px;
    max-width: 80%;
    margin: 1rem auto;
}

/* Table container */
.table-container {
    min-width: 900px;
    max-width: 100%;
    overflow-x: auto;
    padding: 0;
    max-height: 70vh;
    overflow-y: auto;
    background-color: var(--main-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--rainbow-3) var(--secondary-bg-color);
    position: relative;
}

.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--secondary-bg-color);
}

.table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--rainbow-1), var(--rainbow-3), var(--rainbow-5));
    border-radius: 4px;
}

/* Table styles */
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.9rem;
    margin: 0;
}

thead {
    position: sticky;
    top: 0;
    background-color: var(--secondary-bg-color);
    z-index: 1;
}

th {
    background-color: var(--secondary-bg-color);
    color: var(--rainbow-5);
    font-weight: bold;
    padding: 10px 6px;
    text-align: left;
    border-bottom: 2px solid var(--rainbow-5);
}

td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    word-wrap: break-word;
}

tr:hover {
    background-color: var(--hover-bg-color);
}

/* Column widths */
th:nth-child(1), td:nth-child(1) { /* Row # */
    min-width: 30px;
    width: 3%;
    max-width: 40px;
    text-align: center;
}

th:nth-child(2), td:nth-child(2) { /* Winner */
    min-width: 60px;
    width: 7%;
    max-width: 90px;
}

th:nth-child(3), td:nth-child(3) { /* Twitch */
    min-width: 60px;
    width: 7%;
    max-width: 90px;
}

th:nth-child(4), td:nth-child(4) { /* Discord */
    min-width: 60px;
    width: 7%;
    max-width: 90px;
}

th:nth-child(5), td:nth-child(5) { /* Website */
    min-width: 60px;
    width: 5%;
    max-width: 60px;
    text-align: center;
}

th:nth-child(6), td:nth-child(6) { /* Giveaway */
    min-width: 100px;
    width: 14%;
    max-width: 140px;
}

th:nth-child(7), td:nth-child(7) { /* Discount */
    min-width: 80px;
    width: 10%;
    max-width: 120px;
}

th:nth-child(8), td:nth-child(8) { /* Ships From */
    min-width: 50px;
    width: 6%;
    max-width: 90px;
}

th:nth-child(9), td:nth-child(9) { /* Shipping */
    min-width: 80px;
    width: 10%;
    max-width: 120px;
}

th:nth-child(10), td:nth-child(10) { /* Pictures */
    min-width: 50px;
    width: 5%;
    max-width: 70px;
    text-align: center;
}

/* Link styles */
.website-link {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
}

/* Website icon styles */
.website-icon {
    color: var(--rainbow-2);
    font-size: 1.2rem;
    transition: color 0.3s;
}

.website-icon:hover {
    color: var(--rainbow-light-2);
}

/* Multiple URLs icon styles */
.website-icon .fa-stack {
    font-size: 1em;
    margin-left: -0.2em;
}

.website-icon:hover .fa-plus {
    color: var(--rainbow-light-3) !important;
}

.discord-link {
    display: inline-block;
    background: linear-gradient(90deg, var(--rainbow-5), var(--rainbow-4));
    color: white !important;
    border-radius: 3px;
    padding: 3px 6px;
    text-decoration: none;
    font-size: 0.75rem;
    white-space: nowrap;
    transition: all 0.3s;
}

.discord-link:hover {
    background: linear-gradient(90deg, var(--rainbow-5), var(--rainbow-1));
    text-decoration: none;
}

/* No results message */
#no-results {
    text-align: center;
    padding: 2rem;
    color: var(--secondary-text-color);
    display: none;
}

/* Completed giveaway styles */
.completed-giveaway {
    color: var(--completed-color);
    background-color: var(--completed-bg);
}

.completed-giveaway:hover {
    background-color: var(--completed-hover-bg);
}

/* First available giveaway styles */
.first-available {
    position: relative;
    animation: highlight-pulse 2s ease-in-out;
}

@keyframes highlight-pulse {
    0% { background-color: var(--row-highlight-color); }
    70% { background-color: var(--row-highlight-color); }
    100% { background-color: transparent; }
}

/* Scroll hint */
.scroll-hint {
    text-align: center;
    padding: 5px;
    margin-top: 5px;
    color: var(--rainbow-light-4);
    font-size: 0.8rem;
    opacity: 0.8;
    animation: fade-in-out 2s infinite;
}

.scroll-hint.fade-out {
    animation: fade-out 0.5s forwards;
}

@keyframes fade-in-out {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

@keyframes fade-out {
    from { opacity: 0.8; }
    to { opacity: 0; }
}

/* For smaller screens - disabled to force desktop view on mobile */
/* 
@media (max-width: 900px) {
    th, td {
        padding: 6px 4px;
        font-size: 0.85rem;
    }
    
    .header h1 {
        font-size: 1.3rem;
    }
    
    .header p {
        font-size: 0.8rem;
    }
}
*/

/* Refresh button */
.refresh-container {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

.auto-update-container {
    display: flex;
    align-items: center;
    margin-right: 10px;
    background-color: rgba(0, 204, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.auto-update-container label {
    color: var(--text-color);
    font-size: 0.75rem;
    margin-left: 5px;
    user-select: none;
    cursor: pointer;
}

.auto-update-checkbox {
    cursor: pointer;
    accent-color: var(--rainbow-2);
}

.refresh-btn {
    background: linear-gradient(135deg, var(--rainbow-1), var(--rainbow-5));
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.refresh-btn:hover {
    background: linear-gradient(135deg, var(--rainbow-light-1), var(--rainbow-light-5));
    transform: rotate(45deg);
}

.refresh-btn:active {
    transform: scale(0.95) rotate(45deg);
}

.refresh-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* Animation for auto-update */
.refresh-btn.auto-updated {
    animation: auto-update-flash 1s ease;
}

@keyframes auto-update-flash {
    0% { transform: scale(1); background: linear-gradient(135deg, var(--rainbow-1), var(--rainbow-5)); }
    50% { transform: scale(1.2); background: linear-gradient(135deg, var(--rainbow-light-1), var(--rainbow-light-5)); box-shadow: 0 0 10px var(--rainbow-light-4); }
    100% { transform: scale(1); background: linear-gradient(135deg, var(--rainbow-1), var(--rainbow-5)); }
}

/* Table loading state */
.table-loading {
    position: relative;
    filter: blur(3px);
    pointer-events: none;
    opacity: 0.7;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

/* Initial loading state - add more dramatic blur for initial content load */
.initial-loading {
    filter: blur(5px);
    opacity: 0.6;
    transition: all 0.5s ease-in-out;
}

.table-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(18, 18, 18, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    backdrop-filter: blur(2px); /* Add backdrop blur for additional effect */
}

.table-spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--rainbow-1);
    border-right: 3px solid var(--rainbow-3);
    border-bottom: 3px solid var(--rainbow-5);
    border-left: 3px solid var(--rainbow-2);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: table-spin 1s linear infinite;
}

@keyframes table-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
.footer {
    text-align: center;
    padding: 0.25rem 0;
    margin-top: 0.4rem;
    color: var(--rainbow-3);
    background-color: var(--secondary-bg-color);
    border-top: 1px solid var(--border-color);
}

.footer p {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.2;
}

.footer a {
    color: var(--rainbow-3);
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: var(--rainbow-light-3);
    text-decoration: underline;
}

.heart {
    color: #ff4d4d;
    font-size: 1.2em;
    display: inline-block;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Force desktop view for all devices */
html, body {
    min-width: 1024px;
    overflow-x: auto;
}

/* Website Link Modal Popup */
.website-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    transition: opacity 0.3s ease;
}

.website-modal-content {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    padding: 25px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s;
    border: 1px solid var(--border-color);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.website-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.website-modal-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-text-color);
}

.website-modal-close {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--secondary-text-color);
    background: none;
    border: none;
    padding: 0;
    transition: color 0.2s;
}

.website-modal-close:hover {
    color: var(--primary-text-color);
}

.website-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.website-list-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.website-list-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.website-list-link {
    color: var(--rainbow-2);
    text-decoration: none;
    display: block;
    word-break: break-all;
    font-size: 1rem;
    padding: 10px;
    transition: all 0.3s;
    border-radius: 6px;
    background-color: rgba(0, 0, 0, 0.05);
}

.website-list-link:hover {
    background-color: var(--hover-bg);
    color: var(--rainbow-light-2);
    transform: translateX(5px);
} 