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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/DSC08781.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 0.5;
    z-index: -1;
}

.container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    max-width: 1200px;
    width: 100%;
}

.main-form-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    padding: 40px;
    flex: 1;
}

h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 150px;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.char-count {
    text-align: right;
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.loading {
    display: none;
    text-align: center;
    color: #667eea;
    margin-top: 10px;
}

.loading.active {
    display: block;
}

.entry-count {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 14px;
}

.entry-count #countValue {
    font-weight: 600;
    color: #667eea;
    display: inline-block;
    transition: transform 0.3s ease;
}

.entry-count #countValue.count-changed {
    animation: countPulse 5.6s ease;
}

@keyframes countPulse {
    0% {
        transform: scale(1);
        color: #667eea;
    }
    5% {
        transform: scale(1.7);
        color: #dc3545;
    }
    95% {
        transform: scale(1.7);
        color: #dc3545;
    }
    100% {
        transform: scale(1);
        color: #667eea;
    }
}

.captcha-group {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.captcha-group.hidden {
    display: none;
}

.captcha-question {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.captcha-question span {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.captcha-input {
    width: 100px;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
}

.captcha-input:focus {
    outline: none;
    border-color: #667eea;
}

.captcha-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.captcha-error.show {
    display: block;
}

.random-trivia-box {
    padding: 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 100%;
    flex: 0 0 auto;
}

.random-trivia-box h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 22px;
    text-align: center;
}

.random-trivia-content {
    min-height: 60px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    line-height: 1.6;
}

.loading-trivia {
    text-align: center;
    color: #667eea;
    font-style: italic;
}

.refresh-trivia-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.refresh-trivia-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.refresh-trivia-btn:active:not(:disabled) {
    transform: translateY(0);
}

.refresh-trivia-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 968px) {
    .container {
        flex-direction: column;
    }
    
    .random-trivia-box {
        max-width: 100%;
    }
}
