/* 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;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
}

/* Container */
.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 700px;
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

/* Header */
header h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5em;
    font-weight: 300;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 15px;
    font-weight: 400;
}

.fun-disclaimer {
    background: linear-gradient(135deg, #FFE082 0%, #FFCC02 100%);
    color: #333;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    margin: 0 auto 30px;
    max-width: 400px;
    box-shadow: 0 2px 8px rgba(255, 204, 2, 0.3);
    animation: gentle-bounce 2s ease-in-out infinite;
}

/* Input section */
.input-section {
    transition: all 0.3s ease;
}

.input-section.hidden {
    display: none;
}

.input-group {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 15px;
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.input-wrapper {
    position: relative;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-weight: 500;
    font-size: 0.9em;
    text-align: left;
}

input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

input:hover {
    border-color: #999;
}

/* Buttons */
.generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 45px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

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

.generate-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;
}

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

/* Results section */
.results {
    text-align: left;
    background: #f8f9ff;
    border-radius: 15px;
    padding: 25px;
    margin-top: 20px;
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

.results-header {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.reset-button, .share-button {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-button {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.reset-button:hover, .share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(118, 75, 162, 0.3);
}

.share-button:hover {
    box-shadow: 0 8px 16px rgba(76, 175, 80, 0.3);
}

/* Fact sections */
.fact-section {
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: slideInLeft 0.5s ease-out;
}

.fact-section:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.fact-section:last-child {
    margin-bottom: 0;
}

.fact-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fact-content {
    color: #555;
    line-height: 1.7;
    font-size: 1em;
}

.fact-content p {
    margin-bottom: 8px;
}

.fact-content strong {
    color: #333;
    font-weight: 600;
}

.date-display {
    font-size: 1.5em;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 25px;
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.1);
}

/* Loading animation */
.loading {
    display: none;
    color: #667eea;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

/* Footer */
footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    margin-top: 20px;
}

.disclaimer {
    font-size: 0.8em;
    margin-top: 5px;
    opacity: 0.7;
}

.creator {
    font-size: 0.9em;
    margin-top: 8px;
    opacity: 0.9;
    font-weight: 500;
}

/* Animations */
@keyframes gentle-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-2px);
    }
}

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

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

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

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 25px;
        margin: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .input-group {
        grid-template-columns: 1fr;
        gap: 15px;
        max-width: 280px;
    }
    
    .generate-btn {
        padding: 15px 35px;
        font-size: 16px;
    }
    
    .fact-section {
        padding: 15px;
    }
    
    .fact-title {
        font-size: 1.1em;
    }
    
    .results-header {
        flex-direction: column;
        align-items: center;
    }
    
    .reset-button, .share-button {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    input {
        padding: 12px;
        font-size: 14px;
    }
    
    .generate-btn {
        padding: 12px 30px;
        font-size: 14px;
    }
    
    .date-display {
        font-size: 1.3em;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .container {
        background: white;
        border: 2px solid #333;
    }
    
    input {
        border-color: #333;
    }
    
    .fact-section {
        border: 1px solid #333;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loading-spinner {
        animation: none;
    }
}