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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    color: #1f2937;
}

/* Utility Classes */
.hidden { display: none !important; }
.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 1rem; 
}

/* Background */
.bg-gradient {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    min-height: 100vh;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid #fecaca;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, #f87171 0%, #14b8a6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 1.25rem;
}

.logo-title {
    font-size: 1.875rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ef4444 0%, #14b8a6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
}

.desktop-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 2.5rem;
}

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

.btn-icon {
    font-size: 1rem;
}

.btn-results {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-results:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    transform: translateY(-1px);
}

.btn-share {
    background: #1d4ed8;
    color: white;
}

.btn-share:hover:not(:disabled) {
    background: #1e40af;
}

.btn-tweet {
    background: #0ea5e9;
    color: white;
}

.btn-tweet:hover:not(:disabled) {
    background: #0284c7;
}

.btn-add {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: 700;
}

.btn-add:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-outline {
    background: transparent;
    border: 2px solid #d1d5db;
    color: #374151;
}

.btn-outline:hover:not(:disabled) {
    border-color: #6b7280;
    background: #f9fafb;
}

.btn-spin {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: white;
    font-size: 1.25rem;
    font-weight: 800;
    padding: 1rem 2rem;
    border-radius: 9999px;
    box-shadow: 0 8px 15px rgba(239, 68, 68, 0.3);
    margin-top: 2rem;
    min-height: 3.5rem;
}

.btn-spin:hover:not(:disabled) {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    transform: scale(1.05);
}

.btn-spin:disabled {
    background: #d1d5db;
    color: #9ca3af;
    box-shadow: none;
    transform: none;
}

.btn-spin-again {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    margin-top: 1.5rem;
}

.btn-destructive {
    background: #ef4444;
    color: white;
}

.btn-destructive:hover:not(:disabled) {
    background: #dc2626;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr 3fr;
    }
}

/* Card */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-header {
    padding: 1.5rem 1.5rem 0 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.card-icon {
    font-size: 1.25rem;
}

.card-content {
    padding: 1.5rem;
}

.wheel-content {
    text-align: center;
}

/* Sidebar */
.sidebar {
    order: 2;
}

@media (min-width: 1024px) {
    .sidebar {
        order: 1;
    }
}

/* Add Entry Form */
.add-entry-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.entry-input {
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.entry-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Entries List */
.entries-list {
    margin-bottom: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.entry-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid;
}

.entry-name {
    font-weight: 500;
    flex: 1;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    padding: 4px 8px;
    border-radius: 4px;
    margin: -4px -8px;
}

.entry-name:hover {
    background-color: #e5e7eb;
    color: #3b82f6;
}

.entry-edit-input {
    background: white;
    border: 2px solid #3b82f6;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: inherit;
    font-weight: 500;
    color: #374151;
    outline: none;
    flex: 1;
    margin: -6px -8px;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.entry-remove {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.entry-remove:hover {
    background: #dc2626;
}

/* Checkbox */
.checkbox-container {
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
}

.checkbox {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: #3b82f6;
}

/* Control Buttons */
.control-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
}

/* Wheel */
.wheel-area {
    order: 1;
}

@media (min-width: 1024px) {
    .wheel-area {
        order: 2;
    }
}

.wheel-container {
    margin-bottom: 2rem;
}

.wheel-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#wheelCanvas {
    border-radius: 50%;
    border: none;
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.3), 
                0 0 15px rgba(78, 205, 196, 0.2), 
                0 0 20px rgba(254, 202, 87, 0.1);
    transition: transform 3s cubic-bezier(0.23, 1, 0.32, 1);
}

.wheel-arrow {
    position: absolute;
    left: 50%;
    top: -15px;
    transform: translateX(-50%);
    z-index: 20;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}

/* Result Display */
.result-display {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.result-content {
    max-width: 400px;
    margin: 0 auto;
}

.result-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.result-title {
    font-size: 1.875rem;
    font-weight: 800;
    color: #92400e;
    margin-bottom: 1rem;
}

.result-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    padding: 1rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

/* How to Use */
.how-to-use {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: left;
    margin-top: 2rem;
}

.how-to-use-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.how-to-use-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.how-to-use-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.how-to-use-number {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.how-to-use-item:nth-child(1) .how-to-use-number { background: #ef4444; }
.how-to-use-item:nth-child(2) .how-to-use-number { background: #14b8a6; }
.how-to-use-item:nth-child(3) .how-to-use-number { background: #eab308; }
.how-to-use-item:nth-child(4) .how-to-use-number { background: #ec4899; }

.how-to-use-item p {
    font-size: 0.875rem;
    color: #374151;
}

/* Mobile Buttons */
.mobile-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
    padding: 0 1rem;
}

.mobile-btn {
    flex: 1;
}

@media (min-width: 640px) {
    .mobile-buttons {
        display: none;
    }
    
    .desktop-buttons {
        display: flex;
    }
    
    .btn-text {
        display: inline;
    }
}

@media (max-width: 639px) {
    .desktop-buttons {
        display: none;
    }
    
    .btn-text {
        display: none;
    }
    
    .logo-title {
        font-size: 1.5rem;
    }
}

/* Footer */
.footer {
    background: #1f2937;
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.footer-logo-icon {
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, #f87171 0%, #14b8a6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
}

.footer-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
}

.footer-description {
    color: #9ca3af;
    margin-bottom: 1rem;
}

.footer-copyright {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    width: 100%;
    max-width: 42rem;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-icon {
    color: #eab308;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #374151;
}

.modal-body {
    padding: 1.5rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.no-results-icon {
    font-size: 4rem;
    opacity: 0.5;
    margin-bottom: 1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
}

.stat-blue { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); }
.stat-green { background: linear-gradient(135deg, #d1fae5 0%, #bbf7d0 100%); }
.stat-purple { background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%); }

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-blue .stat-number { color: #1d4ed8; }
.stat-green .stat-number { color: #059669; }
.stat-purple .stat-number { color: #7c3aed; }

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Modal Section */
.modal-section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Winner Stats */
.winner-stats {
    max-height: 10rem;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.winner-stat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.winner-stat-item:last-child {
    margin-bottom: 0;
}

.winner-stat-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.winner-badge {
    background: #3b82f6;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

.winner-badge.secondary {
    background: #6b7280;
}

.winner-name {
    font-weight: 500;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.winner-stats-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Recent Spins */
.recent-spins {
    max-height: 10rem;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.recent-spin-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.875rem;
}

.recent-spin-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spin-color {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}

.spin-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-spin-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* Confetti */
.confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* Responsive */
@media (max-width: 768px) {
    .main-grid {
        gap: 1.5rem;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .wheel-wrapper {
        width: 280px;
        height: 280px;
    }
    
    #wheelCanvas {
        width: 280px;
        height: 280px;
    }
    
    .how-to-use-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinning-icon {
    animation: spin 1s linear infinite;
}

/* Scrollbar Styling */
.entries-list::-webkit-scrollbar,
.winner-stats::-webkit-scrollbar,
.recent-spins::-webkit-scrollbar {
    width: 6px;
}

.entries-list::-webkit-scrollbar-track,
.winner-stats::-webkit-scrollbar-track,
.recent-spins::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.entries-list::-webkit-scrollbar-thumb,
.winner-stats::-webkit-scrollbar-thumb,
.recent-spins::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.entries-list::-webkit-scrollbar-thumb:hover,
.winner-stats::-webkit-scrollbar-thumb:hover,
.recent-spins::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}