@font-face {
    font-family: 'Kenyan Coffee';
    src: url('fonts/KENYAN_COFFEE_RG.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@supports not (font-display: swap) {
    .title, .admin-title, .modal-title {
        font-family: 'Bebas Neue', 'Orbitron', sans-serif !important;
    }
}

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

:root {
    --purple: #9431ce;
    --black: #000000;
    --dark-gray: #0a0a0a;
    --purple-glow: rgba(148, 49, 206, 0.4);
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--black);
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
}

.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.bg-animation::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 50%, var(--purple-glow) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, var(--purple-glow) 0%, transparent 50%);
    animation: bgRotate 20s linear infinite;
}

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

.container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px var(--purple-glow));
}

.title {
    font-family: 'Kenyan Coffee', 'Orbitron', sans-serif;
    font-size: 36px;
    font-weight: 900;
    color: var(--purple);
    margin-bottom: 10px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.6);
}

.raffle-card {
    background: rgba(10, 10, 10, 0.8);
    border: 2px solid rgba(148, 49, 206, 0.3);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
}

.raffle-image {
    width: 100%;
    max-width: 500px;
    height: 500px;
    margin: 0 auto 30px;
    border-radius: 15px;
    overflow: hidden;
    border: 3px solid var(--purple);
    box-shadow: 0 10px 40px var(--purple-glow);
}

.raffle-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.3);
}

.raffle-info {
    text-align: center;
    margin-bottom: 30px;
}

.raffle-title {
    font-family: 'Kenyan Coffee', 'Orbitron', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
}

.raffle-description {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

.raffle-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.stat-box {
    background: rgba(148, 49, 206, 0.1);
    border: 2px solid var(--purple);
    border-radius: 10px;
    padding: 15px 25px;
    text-align: center;
}

.stat-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 5px;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--purple);
}

.promo-badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: black;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 700;
    display: inline-block;
    margin-top: 10px;
    animation: pulse 2s ease-in-out infinite;
}

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

.numbers-section {
    margin-bottom: 30px;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

.numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 8px;
    max-width: 800px;
    margin: 0 auto;
}

.number-box {
    aspect-ratio: 1;
    border: 2px solid rgba(148, 49, 206, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.05);
}

.number-box:hover:not(.sold):not(.reserved) {
    border-color: var(--purple);
    background: rgba(148, 49, 206, 0.2);
    transform: scale(1.1);
}

.number-box.selected {
    background: linear-gradient(135deg, var(--purple), #6b1fa0);
    border-color: var(--purple);
    color: white;
    box-shadow: 0 0 15px var(--purple-glow);
}

.number-box.sold {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    opacity: 0.4;
}

.number-box.reserved {
    background: rgba(255, 165, 0, 0.2);
    border-color: rgba(255, 165, 0, 0.5);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
    opacity: 0.5;
}

.legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
    font-size: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid;
}

.checkout-section {
    position: sticky;
    bottom: 0;
    background: rgba(10, 10, 10, 0.95);
    border: 2px solid var(--purple);
    border-radius: 20px 20px 0 0;
    padding: 25px;
    backdrop-filter: blur(10px);
    box-shadow: 0 -10px 40px var(--purple-glow);
}

.checkout-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.selected-count {
    font-size: 18px;
}

.total-price {
    font-family: 'Orbitron', sans-serif;
    font-size: 32px;
    font-weight: 900;
    color: var(--purple);
}

.checkout-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--purple), #6b1fa0);
    border: none;
    border-radius: 12px;
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

.checkout-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px var(--purple-glow);
}

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

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    overflow-y: auto;
    padding: 20px;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(10, 10, 10, 0.95);
    border: 2px solid var(--purple);
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    position: relative;
    backdrop-filter: blur(10px);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 32px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-title {
    font-family: 'Kenyan Coffee', sans-serif;
    font-size: 28px;
    color: var(--purple);
    margin-bottom: 20px;
}

#qrCodeContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

#qrCodeContainer img,
#qrCodeContainer canvas {
    max-width: 100%;
    height: auto;
}

.confirmation-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--purple), #6b1fa0);
    border: 3px solid #00ff88;
    border-radius: 15px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 42px;
    color: white;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(148, 49, 206, 0.4);
    animation: numberPop 0.5s ease-out;
}

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

.admin-trigger {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(10, 10, 10, 0.8);
    border: 2px solid var(--purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.3;
    transition: all 0.3s;
    z-index: 999;
    font-size: 24px;
}

.admin-trigger:hover {
    opacity: 1;
    transform: scale(1.1);
}

.admin-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    overflow-y: auto;
    padding: 40px 20px;
}

.admin-panel.active {
    display: block;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.admin-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 32px;
    font-weight: 900;
    color: var(--purple);
}

.admin-close {
    background: none;
    border: 2px solid var(--purple);
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    transition: all 0.3s;
}

.admin-close:hover {
    background: var(--purple);
}

.admin-section {
    background: rgba(10, 10, 10, 0.8);
    border: 2px solid rgba(148, 49, 206, 0.3);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
}

.admin-section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--purple);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(148, 49, 206, 0.3);
    border-radius: 8px;
    color: white;
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--purple);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--purple), #6b1fa0);
    border: none;
    border-radius: 10px;
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--purple-glow);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(148, 49, 206, 0.1);
    border: 2px solid var(--purple);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.sales-list {
    max-height: 400px;
    overflow-y: auto;
}

.sale-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 49, 206, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
}

.sale-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 700;
}

.numbers-sold {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.number-badge {
    background: var(--purple);
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 12px;
}

.btn-remove-pending {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: #ff4444;
    border: none;
    border-radius: 8px;
    color: white;
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-remove-pending:hover {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 68, 68, 0.4);
}

.btn-remove-pending:active {
    transform: translateY(0);
}

.btn-approve-manual {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: #00ff88;
    border: none;
    border-radius: 8px;
    color: black;
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-approve-manual:hover {
    background: #00dd77;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.4);
}

.btn-approve-manual:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .title {
        font-size: 28px;
    }

    .raffle-image {
        max-width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .numbers-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
        gap: 6px;
    }

    .number-box {
        font-size: 14px;
    }

    .checkout-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .confirmation-number {
        min-width: 60px;
        height: 60px;
        font-size: 32px;
    }
}
