@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@700&family=Crimson+Text:ital@0;1&display=swap');

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
}

.patriot-header {
    background: linear-gradient(135deg, #E63946 0%, #457B9D 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

.speech-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.speech-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.input-field:focus {
    outline: none;
    border-color: #457B9D;
    box-shadow: 0 0 0 3px rgba(69, 123, 157, 0.1);
    transform: scale(1.02);
}

.input-field::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.generate-btn {
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, #E63946 0%, #d62839 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.3);
}

.generate-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 25px rgba(230, 57, 70, 0.4);
}

.generate-btn:active {
    transform: scale(0.98);
}

.parchment {
    background: linear-gradient(to bottom, #f9f7f4 0%, #f5f3f0 100%);
    border: 3px solid #d4af37;
    border-radius: 8px;
    padding: 24px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.1), 0 4px 12px rgba(212, 175, 55, 0.2);
    position: relative;
    animation: slideUp 0.5s ease-out;
}

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

.parchment::before,
.parchment::after {
    content: '⚜';
    position: absolute;
    color: #d4af37;
    font-size: 24px;
    opacity: 0.3;
}

.parchment::before {
    top: 12px;
    left: 12px;
}

.parchment::after {
    bottom: 12px;
    right: 12px;
}

.speech-text {
    font-family: 'Crimson Text', serif;
    font-size: 18px;
    line-height: 1.8;
    color: #1f2937;
    margin: 0;
}

.action-btn {
    padding: 12px 16px;
    background: #457B9D;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #3d6d8c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(69, 123, 157, 0.3);
}

.action-btn:active {
    transform: translateY(0);
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Dark mode */
.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.dark-mode .speech-card {
    background: #0f3460;
    color: white;
}

.dark-mode .input-field {
    background: #1a1a2e;
    color: white;
    border-color: #457B9D;
}

.dark-mode .parchment {
    background: linear-gradient(to bottom, #2a2a3e 0%, #25253a 100%);
    border-color: #ffd700;
}

.dark-mode .speech-text {
    color: #f1f1f1;
}

.dark-mode footer {
    border-top-color: #457B9D;
}

.dark-mode footer p {
    color: #a0aec0;
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    header, footer, .action-btn, button {
        display: none;
    }
    
    .speech-card {
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .parchment {
        border: 2px solid #000;
        page-break-inside: avoid;
    }
    
    .speech-text {
        font-size: 14pt;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .patriot-header h1 {
        font-size: 2.5rem;
    }
    
    .speech-card {
        padding: 20px;
    }
    
    .speech-text {
        font-size: 16px;
    }
}

/* Tooltips and accessibility */
button:focus,
input:focus {
    outline: 2px solid #457B9D;
    outline-offset: 2px;
}

details summary {
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

details[open] summary {
    margin-bottom: 8px;
}