/* Base Reset and Roots */
:root {
    --brand-accent: #EF0;
    --bg-dark: #0a0a0a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --success: #EF0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

.blurred {
    filter: blur(20px);
    pointer-events: none;
    user-select: none;
    opacity: 0.4;
    transition: filter 0.5s ease, opacity 0.5s ease;
}

/* Password Overlay */
.password-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.password-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.password-modal {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 320px;
}

#app-password {
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--card-border);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    font-size: 1.2rem;
    font-family: inherit;
    text-align: center;
    transition: border-color 0.3s;
}

#app-password:focus {
    outline: none;
    border-color: var(--brand-accent);
}

.login-btn {
    width: 100%;
    padding: 1rem !important;
    font-size: 1.1rem !important;
}

.error-text {
    color: #ff4d4d;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Atmospheric Background */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 0%, rgba(238, 255, 0, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(238, 255, 0, 0.05) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

/* Typography */
.hero {
    text-align: center;
    animation: fadeInDown 0.8s ease-out;
}

.logo-text {
    font-family: 'TacticSans-BlkIt', 'Outfit', sans-serif;
    font-style: italic;
    font-weight: 900;
    font-size: 4rem;
    color: var(--brand-accent);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    text-shadow: 0 0 20px rgba(238, 255, 0, 0.3);
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Grid Layout for Files */
.upload-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
    animation: fadeInUp 1s ease-out;
}

/* Glassmorphism Cards */
.file-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.file-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.file-card.loaded {
    border-color: var(--brand-accent);
    background: rgba(238, 255, 0, 0.05);
}

.card-icon {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-icon svg {
    stroke: var(--brand-accent);
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 8px rgba(238, 255, 0, 0.4));
}

.animated-icon-followers {
    animation: sway 4s ease-in-out infinite;
}

.animated-icon-likes {
    animation: heartbeat 1.5s infinite;
}

.animated-icon-comments {
    animation: float 3s ease-in-out infinite;
}

@keyframes sway {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.15); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
    60% { transform: scale(1); }
    100% { transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.file-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.file-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Custom File Input */
.file-input {
    display: none;
}

.upload-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    background: rgba(255,255,255,0.2);
}

.file-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.file-status.success {
    color: var(--brand-accent);
    font-weight: 600;
}

/* Actions Section */
.action-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.primary-btn {
    background: var(--brand-accent);
    border: none;
    border-radius: 50px;
    padding: 1.2rem 3rem;
    color: #000;
    font-size: 1.2rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 20px rgba(238, 255, 0, 0.2);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
    color: var(--text-secondary);
}

.primary-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(238, 255, 0, 0.4);
}

/* Results Area */
.results {
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.results.hidden {
    display: none;
}

.eligible-count {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 2rem;
}

#count-display {
    font-weight: 800;
    color: var(--brand-accent);
}

.participants-container {
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.participant-badge {
    background: rgba(255,255,255,0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #ccc;
}

.winners-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 16px;
    background: rgba(238, 255, 0, 0.05);
    border: 1px dashed var(--brand-accent);
}

.winners-section h3 {
    color: var(--brand-accent);
    font-weight: 800;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

#winners-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

#winners-list li {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    background: rgba(0,0,0,0.5);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--brand-accent);
}

.limit-text {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.draw-btn {
    background: var(--brand-accent);
    color: #000;
    border: none;
    border-radius: 50px;
    padding: 1.5rem 4rem;
    font-size: 1.5rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.draw-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(255,255,255,0.4);
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 4rem;
    border-radius: 30px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal h2 {
    font-weight: 300;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.winner-username {
    font-size: 4rem;
    font-weight: 800;
    color: var(--brand-accent);
    margin-bottom: 2rem;
    word-break: break-all;
    text-shadow: 0 0 20px rgba(238, 255, 0, 0.4);
}

.close-btn {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s;
}

.close-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes popIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.app-footer {
    margin-top: auto;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    width: 100%;
}
