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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Random Background Patterns */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        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, 255, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: -1;
    animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% {
        background: 
            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, 255, 0.3) 0%, transparent 50%),
            linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    25% {
        background: 
            radial-gradient(circle at 80% 80%, rgba(255, 119, 198, 0.4) 0%, transparent 50%),
            radial-gradient(circle at 20% 20%, rgba(120, 219, 255, 0.4) 0%, transparent 50%),
            radial-gradient(circle at 60% 60%, rgba(120, 119, 198, 0.4) 0%, transparent 50%),
            linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    50% {
        background: 
            radial-gradient(circle at 40% 20%, rgba(120, 219, 255, 0.3) 0%, transparent 50%),
            radial-gradient(circle at 60% 80%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
            radial-gradient(circle at 80% 40%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
            linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    75% {
        background: 
            radial-gradient(circle at 60% 40%, rgba(255, 119, 198, 0.4) 0%, transparent 50%),
            radial-gradient(circle at 40% 60%, rgba(120, 219, 255, 0.4) 0%, transparent 50%),
            radial-gradient(circle at 20% 60%, rgba(120, 119, 198, 0.4) 0%, transparent 50%),
            linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
}

/* Floating particles effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.2), transparent),
        radial-gradient(2px 2px at 160px 30px, rgba(255,255,255,0.3), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: float 6s ease-in-out infinite;
    z-index: -1;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 15px;
    color: white;
    position: relative;
    z-index: 2;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 5px;
}

.logo i {
    font-size: 1.8rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 0.9rem;
    font-weight: 300;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.main-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.generator-card, .analytics-card, .random-card, .history-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
}

/* Card hover effects */
.generator-card::before, .analytics-card::before, .random-card::before, .history-card::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;
}

.generator-card:hover::before, .analytics-card:hover::before, .random-card:hover::before, .history-card:hover::before {
    left: 100%;
}

.generator-card h3, .analytics-card h3, .random-card h3, .history-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

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

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #555;
    font-size: 0.8rem;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

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

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin: 10px 0;
}

.generate-btn, .random-btn, .batch-btn {
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.random-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.batch-btn {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
}

.generate-btn:hover, .random-btn:hover, .batch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.generate-btn:active, .random-btn:active, .batch-btn:active {
    transform: translateY(0);
}

.result-section {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 2px solid #f0f0f0;
}

.result-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    padding: 10px 12px;
    border-radius: 8px;
    border: 2px solid #e1e5e9;
    margin-top: 8px;
}

#generatedNumber {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    letter-spacing: 1px;
}

.copy-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.75rem;
}

.copy-btn:hover {
    background: #5a6fd8;
    transform: scale(1.05);
}

/* Analytics Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.stat-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e1e5e9;
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.stat-item:hover::before {
    transform: translateX(100%);
}

.stat-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.7rem;
    color: #666;
    font-weight: 500;
}

.chart-container {
    height: 150px;
    margin-top: 10px;
}

/* Random Generator Styles */
.random-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.random-generate-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 10px;
}

.random-generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.3);
}

.random-results {
    max-height: 120px;
    overflow-y: auto;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 8px;
    background: #f8f9fa;
}

.random-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: white;
    border-radius: 5px;
    margin-bottom: 4px;
    border-left: 2px solid #ff6b6b;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

.random-item:hover {
    background: #f8f9fa;
    transform: translateX(2px);
}

.random-item .copy-random {
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 3px 6px;
    cursor: pointer;
    font-size: 0.65rem;
    transition: all 0.3s ease;
}

.random-item .copy-random:hover {
    background: #ee5a24;
    transform: scale(1.05);
}

/* History Styles */
.history-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}

.history-filters select {
    padding: 5px 8px;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    background: #f8f9fa;
    font-size: 0.75rem;
}

.export-btn {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
}

.export-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.history-list {
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 4px;
    border-left: 2px solid #667eea;
    transition: all 0.3s ease;
    font-size: 0.75rem;
}

.history-item:hover {
    background: #e9ecef;
    transform: translateX(2px);
}

.history-number {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #333;
}

.history-time {
    font-size: 0.65rem;
    color: #666;
}

.clear-btn {
    width: 100%;
    padding: 8px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.clear-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    font-size: 0.75rem;
    margin-top: 8px;
    position: relative;
    z-index: 2;
}

.notification {
    position: fixed;
    top: 12px;
    right: 12px;
    background: #28a745;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
    font-size: 0.8rem;
}

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

.notification.error {
    background: #dc3545;
}

/* Responsive Design - Single Breakpoint */
@media (max-width: 800px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .random-options {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        grid-template-columns: 1fr;
    }
    
    .history-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .container {
        padding: 8px;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }
    
    .logo i {
        font-size: 1.4rem;
    }
    
    .generator-card, .analytics-card, .random-card, .history-card {
        padding: 12px;
    }
    
    .chart-container {
        height: 120px;
    }
    
    .random-results, .history-list {
        max-height: 120px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .generate-btn:hover, .random-btn:hover, .batch-btn:hover,
    .random-generate-btn:hover, .copy-btn:hover, .export-btn:hover,
    .clear-btn:hover, .random-item:hover, .history-item:hover {
        transform: none;
    }
    
    .generate-btn:active, .random-btn:active, .batch-btn:active,
    .random-generate-btn:active, .copy-btn:active, .export-btn:active,
    .clear-btn:active {
        transform: scale(0.98);
    }
    
    .random-item:active, .history-item:active {
        transform: translateX(2px);
    }
}

/* Scrollbar Styling */
.history-list::-webkit-scrollbar,
.random-results::-webkit-scrollbar {
    width: 3px;
}

.history-list::-webkit-scrollbar-track,
.random-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.history-list::-webkit-scrollbar-thumb,
.random-results::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 2px;
}

.history-list::-webkit-scrollbar-thumb:hover,
.random-results::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

/* Animation for new items */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.history-item,
.random-item {
    animation: slideIn 0.3s ease;
}

/* Chart customization */
.chart-container canvas {
    border-radius: 8px;
    background: white;
    padding: 6px;
} 