/* CSS Variables - Color Scheme from illustration */
:root {
    --purple-primary: #8B5CF6;
    --purple-medium: #A855F7;
    --purple-light: #C084FC;
    --cyan-accent: #06B6D4;
    --cyan-light: #22D3EE;
    --bg-dark: #0a0a0a;
    --bg-darker: #050505;
    --text-white: #ffffff;
    --text-gray: #b4b4b4;
    --success: #10b981;
    --error: #ef4444;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #000000;
    color: var(--text-white);
    overflow: hidden;
    background-image: linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(10, 5, 15, 0.85) 100%), url('../images/Backprint.png');
    background-size: cover, contain;
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
    background-attachment: fixed, fixed;
}

/* Main Display Styles */
.container {
    max-width: 1920px;
    height: 100vh;
    margin: 0 auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 15px;
    background: linear-gradient(90deg, var(--purple-primary), var(--purple-medium));
    border-radius: 15px;
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.5);
}

.logo-image {
    height: 90px;
    width: auto;
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.8));
    animation: float 3s ease-in-out infinite;
}

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

.header-text {
    text-align: center;
}

.logo {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 3px;
    background: linear-gradient(to right, var(--text-white), var(--cyan-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(34, 211, 238, 0.6);
}

.tagline {
    font-size: 0.9rem;
    margin-top: 5px;
    color: var(--cyan-light);
    letter-spacing: 2px;
    font-weight: 600;
}

/* Total Sum Section */
.total-section {
    flex: 0 0 auto;
}

.total-container {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(168, 85, 247, 0.1));
    border: 2px solid var(--purple-primary);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 0 50px rgba(139, 92, 246, 0.3);
}

.total-label {
    font-size: 1.3rem;
    color: var(--purple-light);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.total-amount {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--text-white);
    text-shadow: 0 0 30px var(--purple-primary);
    transition: all 0.3s ease;
}

.total-donations {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-top: 8px;
}

/* Donations Section */
.donations-section {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.donations-title {
    font-size: 1.5rem;
    color: var(--purple-medium);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.donations-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

.donation-card {
    flex: 1;
    min-height: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(168, 85, 247, 0.1));
    border-left: 4px solid var(--purple-primary);
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.donation-card-new {
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.donation-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-white);
}

.donation-amount {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--cyan-light);
    text-shadow: 0 0 10px var(--cyan-accent);
}

.donation-comment {
    font-size: 1rem;
    color: var(--text-gray);
    font-style: italic;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.loading {
    text-align: center;
    color: var(--text-gray);
    font-size: 1.2rem;
    padding: 40px;
}

/* Wheel Overlay */
.wheel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.wheel-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wheel-container {
    position: relative;
    width: min(1100px, 90vw, 90vh);
    height: min(1100px, 90vw, 90vh);
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 40px rgba(139, 92, 246, 0.6));
}

.wheel-pointer {
    position: absolute;
    top: 50%;
    right: -20px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 25px solid transparent;
    border-bottom: 25px solid transparent;
    border-right: 40px solid var(--cyan-light);
    filter: drop-shadow(0 0 10px var(--cyan-accent));
    z-index: 10;
}

.wheel-result {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-medium));
    padding: 45px 70px;
    border-radius: 25px;
    border: 4px solid var(--text-white);
    font-size: 4rem;
    font-weight: 900;
    text-align: center;
    box-shadow: 0 0 60px rgba(139, 92, 246, 0.9), 0 0 20px rgba(255, 255, 255, 0.3);
    display: none;
    animation: resultPulse 0.5s ease;
}

.wheel-result.show {
    display: block;
}

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

.wheel-instruction {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    color: var(--cyan-light);
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 0 20px rgba(6, 182, 212, 0.8);
    font-weight: 700;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Donation Alerts Frame */
.donation-alerts-frame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 900;
    pointer-events: none;
    background: transparent;
    border: none;
}

/* Admin Panel Styles */
.admin-body {
    background: var(--bg-dark);
    overflow-y: auto;
}

.login-section {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-container {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(168, 85, 247, 0.05));
    border: 2px solid var(--purple-primary);
    border-radius: 20px;
    padding: 50px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 0 50px rgba(139, 92, 246, 0.3);
}

.admin-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(to right, var(--purple-primary), var(--purple-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-subtitle {
    color: var(--text-gray);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.login-form, .add-item-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: var(--purple-light);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input {
    background: rgba(139, 92, 246, 0.1);
    border: 2px solid var(--purple-primary);
    border-radius: 10px;
    padding: 15px;
    color: var(--text-white);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--purple-light);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.form-group small {
    display: block;
    margin-top: 8px;
    color: var(--text-gray);
    font-size: 0.85rem;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-medium));
    color: var(--text-white);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.6);
}

.btn-secondary {
    background: rgba(139, 92, 246, 0.2);
    color: var(--purple-light);
    border: 2px solid var(--purple-primary);
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.3);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
    border: 2px solid var(--error);
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

.error-message {
    color: var(--error);
    font-size: 0.95rem;
    min-height: 20px;
}

.admin-panel {
    min-height: 100vh;
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--purple-primary);
}

.add-item-section {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(168, 85, 247, 0.05));
    border: 2px solid var(--purple-primary);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

.add-item-section h2 {
    color: var(--purple-light);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.items-section h2 {
    color: var(--purple-light);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.item-count {
    color: var(--text-gray);
    font-size: 1.2rem;
}

.items-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.item-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(168, 85, 247, 0.1));
    border-left: 4px solid;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease;
}

.item-text {
    font-size: 1.2rem;
    font-weight: 600;
}

.item-id {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-top: 5px;
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-medium));
    color: var(--text-white);
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.6);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 2000;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    background: linear-gradient(135deg, var(--error), #dc2626);
}

.toast.success {
    background: linear-gradient(135deg, var(--success), #059669);
}

/* Last Wheel Spin Display */
.last-spin-display {
    position: fixed;
    bottom: 15px;
    right: 15px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(168, 85, 247, 0.1));
    border: 1px solid var(--purple-primary);
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
    z-index: 800;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
}

.last-spin-display.visible {
    opacity: 0.85;
    transform: translateY(0);
}

.last-spin-label {
    font-size: 0.65rem;
    color: var(--purple-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
    font-weight: 600;
}

.last-spin-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-white);
    text-shadow: 0 0 5px rgba(139, 92, 246, 0.4);
}
