/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

h1 {
    color: white;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#auth-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

#user-info {
    color: white;
    margin-right: 10px;
    font-weight: bold;
}

/* Grid layout */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.main-panel {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* Panels */
.panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.panel h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
    text-align: center;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.history-panel h2,
.logs-panel h2 {
    font-size: 1.25rem;
}

/* Controls */
.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    justify-content: center;
}

#count-select {
    padding: 12px 20px;
    border: 2px solid #667eea;
    border-radius: 25px;
    background: white;
    font-size: 1rem;
    font-weight: 600;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

#count-select:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

#count-select:focus {
    outline: none;
    border-color: #764ba2;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '\;
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(-1px);
}

.btn.primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn.secondary {
    background: linear-gradient(45deg, #f093fb, #f5576c);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

/* Numbers display */
.numbers-display {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    min-height: 140px;
    align-items: center;
    padding: 20px;
}

.number-ball {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 900;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), inset 0 2px 5px rgba(255, 255, 255, 0.3);
    animation: ballAppear 0.8s ease-out forwards;
    opacity: 0;
    transform: scale(0.3) rotate(-180deg);
    position: relative;
}

.number-ball::before {
    content: '\;
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.3), transparent);
    z-index: -1;
}

@keyframes ballAppear {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-180deg) translateY(50px);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2) rotate(0deg) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg) translateY(0);
    }
}

.number-ball:nth-child(1) { background: linear-gradient(135deg, #ff6b6b, #ee5a24); animation-delay: 0.1s; }
.number-ball:nth-child(2) { background: linear-gradient(135deg, #4ecdc4, #44a08d); animation-delay: 0.2s; }
.number-ball:nth-child(3) { background: linear-gradient(135deg, #45b7d1, #96c93d); animation-delay: 0.3s; }
.number-ball:nth-child(4) { background: linear-gradient(135deg, #f9ca24, #f0932b); animation-delay: 0.4s; }
.number-ball:nth-child(5) { background: linear-gradient(135deg, #6c5ce7, #a29bfe); animation-delay: 0.5s; }
.number-ball:nth-child(6) { background: linear-gradient(135deg, #fd79a8, #e84393); animation-delay: 0.6s; }
.number-ball:nth-child(7) { background: linear-gradient(135deg, #00b894, #00cec9); animation-delay: 0.7s; }
.number-ball:nth-child(8) { background: linear-gradient(135deg, #e17055, #d63031); animation-delay: 0.8s; }

/* History lists */
.history-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.history-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.history-line-numbers {
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    color: #2d3436;
    white-space: nowrap;
}

.history-line-date {
    font-size: 0.65rem;
    color: #666;
    white-space: nowrap;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    margin: 10% auto;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
    margin-top: -10px;
}

.close:hover {
    color: #667eea;
}

/* Auth forms */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form input {
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.auth-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.auth-form h3 {
    text-align: center;
    margin-bottom: 10px;
    color: #333;
    font-size: 1.8rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Floating particles animation */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

body::before {
    content: '\;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 226, 0.3) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    z-index: -1;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
        padding: 16px;
    }

    .number-ball {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .modal-content {
        margin: 5% auto;
        padding: 20px;
        width: 95%;
    }
}

/* Loading animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Success message styling */
.success-message {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin: 10px 0;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

/* Welcome message styling */
.welcome-message {
    text-align: center;
    color: #666;
    padding: 40px 20px;
}

.welcome-message h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-message p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.sparkles {
    font-size: 2rem;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.7; }
    50% { transform: scale(1.2) rotate(180deg); opacity: 1; }
}

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.6;
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* Enhanced button effects */
.btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(-1px) scale(0.98);
}

/* Add Poppins font */
body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Enhanced number ball effects */
.number-ball {
    cursor: pointer;
    transition: all 0.3s ease;
}

.number-ball:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4), inset 0 2px 5px rgba(255, 255, 255, 0.4);
}

/* Add subtle glow to panels */
.panel::before {
    content: '\;
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c);
    border-radius: 17px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.panel:hover::before {
    opacity: 0.3;
}

.panel {
    position: relative;
}

/* Enhanced modal backdrop */
.modal {
    backdrop-filter: blur(8px);
}

/* Add loading spinner */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #667eea;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background: linear-gradient(45deg, #4CAF50, #45a049);
}

.notification.error {
    background: linear-gradient(45deg, #f44336, #d32f2f);
}

/* Enhanced focus states */
.auth-form input:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

/* Add subtle animations to history items */
.history-item {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.history-item:nth-child(1) { animation-delay: 0.1s; }
.history-item:nth-child(2) { animation-delay: 0.2s; }
.history-item:nth-child(3) { animation-delay: 0.3s; }

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

.auth-form .input-label {
    display: block;
    font-weight: 600;
    margin-top: 12px;
    margin-bottom: 6px;
    color: #444;
}

.auth-form .input-label:first-of-type {
    margin-top: 0;
}

.required {
    color: #e63946;
    margin-left: 4px;
}
