/* Reset y configuración base - Updated hover colors for better contrast - v2 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #f39c12;
    --accent-hover: #e67e22;
    --background-color: #ffffff;
    --background-light: #fef9e7;
    --border-color: #bdc3c7;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --light-gray: #ecf0f1;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --error-color: #e74c3c;
    --yellow-primary: #f1c40f;
    --yellow-secondary: #f39c12;
    --orange-accent: #e67e22;
    --blue-accent: #3498db;
    --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 20px rgba(0,0,0,0.15);
    --gradient-primary: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    --gradient-secondary: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    --white: #ffffff;
    --border-radius: 4px;
    --box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    --transition: all 0.2s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: white;
    font-size: 16px;
    min-height: 100vh;
}

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

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    color: var(--secondary-color);
}

h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem 0;
    color: var(--accent-color);
}

h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem 0;
    color: var(--secondary-color);
}

p {
    margin-bottom: 1rem;
    color: var(--text-color);
    line-height: 1.7;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

ul, ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

/* Header */
.header {
    background: white;
    border-bottom: none;
    padding: 3rem 0;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
}

.header-text {
    text-align: center;
    width: 100%;
}

.header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    letter-spacing: normal;
}

.header .subtitle {
    color: #666;
    font-size: 1rem;
    margin-top: 0.5rem;
    font-weight: 400;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-text {
        text-align: center;
    }
    
    .language-selector {
        bottom: 15px;
        left: 15px;
    }
    
    .language-btn {
        width: 35px;
        height: 35px;
        padding: 6px;
    }
    
    .flag-icon {
        width: 20px;
        height: 15px;
    }
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Main Section */
.main-section {
    padding: 2rem 0;
    background: white;
}

.generator-container {
    background: white;
    border: none;
    border-radius: 0;
    padding: 2rem;
    box-shadow: none;
    margin-bottom: 2rem;
}

.generator-header {
    text-align: left;
    margin-bottom: 1.5rem;
}

.generator-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
    font-weight: 400;
    display: none;
}

/* Form Styles */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #f1c40f;
    box-shadow: 0 0 0 2px rgba(241,196,15,0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Generate Button */
.generate-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: #f1c40f;
    color: #2c3e50;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    text-transform: none;
    letter-spacing: 0.5px;
}

.generate-btn:hover {
    background: #2c3e50;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44,62,80,0.3);
}

/* Results Section */
.results-section {
    margin-top: 2rem;
}

.result-group {
    margin-bottom: 2rem;
}

.result-group h3 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.result-box {
    position: relative;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 0.5rem;
}

.result-box code {
    display: block;
    word-break: break-all;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-color);
    background: transparent;
    padding: 0;
    margin: 0;
    line-height: 1.4;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.75rem;
}

.copy-btn:hover {
    background: #0056b3;
}

.test-box {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
}

.test-link {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.test-link:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
}

/* Content Section */
.content-section {
    padding: 3rem 0;
    background: var(--white);
    border-top: 1px solid var(--border-color);
}

.content-section .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.content-section h2 {
    color: #333;
    margin: 2rem 0 1rem 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.content-section h3 {
    color: #333;
    margin: 1.5rem 0 1rem 0;
    font-size: 1.3rem;
    font-weight: 500;
}

.content-section h4 {
    color: #333;
    margin: 1rem 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.content-section p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.content-section ul {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.content-section li {
    margin-bottom: 0.5rem;
}

/* Table of contents */
.table-of-contents {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.table-of-contents h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #333;
}

.table-of-contents ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.table-of-contents li {
    margin-bottom: 0.5rem;
}

.table-of-contents a {
    color: #007bff;
    text-decoration: none;
    padding: 0.25rem 0;
    display: block;
    transition: color 0.3s ease;
}

.table-of-contents a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Code examples */
.code-example {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
}

.code-example code {
    background: none;
    padding: 0;
    color: #333;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Test box for demo links */
.test-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.test-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.test-link {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
    border: none;
    cursor: pointer;
}

.test-link:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
    color: white;
    text-decoration: none;
}

.test-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

/* Donation Section */
.donation-section {
    background-color: white;
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid #eee;
}

.donation-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

.donation-content h2 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 700;
}

.donation-content p {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.6;
}

.coffee-price {
    font-size: 1.1rem;
    margin-bottom: 1.5rem !important;
    color: var(--text-color);
}

.donation-buttons {
    margin-bottom: 2rem;
}

.coffee-btn {
    background: #f1c40f;
    color: #2c3e50;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.coffee-btn:hover {
    background: #2c3e50;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44,62,80,0.3);
}

.donation-note {
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.6;
}

.donation-note strong {
    color: var(--text-color);
}

/* Footer */
.footer {
    background: var(--white);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-content p {
    color: var(--text-light);
    margin: 0;
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Language Selector Styles */
.language-selector {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

.language-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.language-btn:hover {
    border-color: #f1c40f;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: translateY(-2px) scale(1.05);
}

.flag-icon {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 3px;
}

#currentLang,
.dropdown-arrow {
    display: none;
}

.language-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: white;
    border: 2px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1001;
    margin-bottom: 8px;
}

.language-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background-color: #f8f9fa;
}

.language-option .flag-icon {
    width: 20px;
    height: 15px;
}

.language-option span {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Header positioning for language selector */
.header {
    position: relative;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .header {
        padding: 1.5rem 0;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .donation-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .donate-btn {
        width: 200px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .footer-links {
        gap: 1rem;
    }
    
    .language-menu {
        left: 0;
        transform: translateY(10px);
    }
    
    .language-menu.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .generator-card {
        padding: 1rem;
    }
    
    .donate-card {
        padding: 2rem 1rem;
    }
}

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

.results-section {
    animation: fadeIn 0.5s ease-out;
}

/* Copy feedback */
.copy-btn.copied {
    background: var(--secondary-color) !important;
}

.copy-btn.copied::after {
    content: ' ✓';
}

/* Loading state */
.generate-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.fa-spin {
    animation: fa-spin 1s infinite linear;
}

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