/* Reset y configuración base */
* {
    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;
    color: #333;
    line-height: 1.6;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.header-logo {
    max-height: 80px;
    max-width: 300px;
    height: auto;
    width: auto;
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Card principal */
.calculator-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

.calculator-section {
    padding: 30px;
    border-bottom: 1px solid #f0f0f0;
}

.calculator-section h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
}

/* Formularios */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.95rem;
}

.form-select, .form-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

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

.form-select:hover, .form-input:hover {
    border-color: #c1c9d2;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-symbol {
    position: absolute;
    right: 15px;
    color: #666;
    font-weight: 600;
    pointer-events: none;
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Mensajes de error */
.error-message {
    background: #fee;
    color: #c53030;
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 4px solid #c53030;
    margin-top: 10px;
    font-size: 0.9rem;
}

/* Sección de resultados */
.result-section {
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.result-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

.result-display {
    text-align: center;
}

.result-amount {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.result-label {
    display: block;
    color: #666;
    font-size: 1rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #27ae60;
    margin-right: 10px;
}

.result-currency {
    font-size: 1.2rem;
    color: #666;
    font-weight: 600;
}

/* Segunda línea de resultado para PayPal */
.result-amount-secondary {
    margin-top: 15px;
    margin-bottom: 25px;
    padding-top: 15px;
    border-top: 1px solid #e1e8ed;
}

.result-label-secondary {
    display: block;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.result-value-secondary {
    font-size: 1.8rem;
    font-weight: 600;
    color: #3498db;
    margin-right: 8px;
}

.result-currency-secondary {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

/* Detalles del cálculo */
.calculation-details {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
}

.detail-item:last-child {
    border-bottom: none;
    font-weight: 600;
    color: #27ae60;
}

.toggle-details {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.toggle-details:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

/* Formulario del receptor */
.recipient-form {
    padding: 30px;
    border-top: 1px solid #f0f0f0;
    background: #fafbfc;
}

.recipient-form h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

#dynamic-fields {
    margin-bottom: 25px;
}

.dynamic-field {
    margin-bottom: 15px;
}

.dynamic-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.dynamic-field input, .dynamic-field select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

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

/* Botón de acción */
.action-button {
    width: 100%;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    border: none;
    padding: 18px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.3);
}

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

/* Footer */
.footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Indicadores de tasa unificados */
.tasa-indicator-unified {
    margin-top: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-wrap: nowrap;
    justify-content: center;
    white-space: nowrap;
}

.tasa-prefix {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.tasa-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.tasa-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.tasa-value {
    font-weight: 700;
    color: #FFD700;
}

.tasa-status {
    font-size: 0.8rem;
    animation: pulse 2s infinite;
}

.tasa-status.success {
    animation: none;
    color: #4CAF50;
}

.tasa-status.error {
    animation: none;
    color: #f44336;
}

/* Contenedor para múltiples indicadores de tasa */
.tasas-container {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

/* Estilos específicos para el indicador de tasa del header */
.header-tasa {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.footer-link {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-link a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    opacity: 0.9;
}

.footer-link a:hover {
    opacity: 1;
    text-decoration: underline;
    color: #ffc107;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .calculator-section, .result-section, .recipient-form {
        padding: 20px;
    }
    
    .result-value {
        font-size: 2rem;
    }
    
    .form-select, .form-input {
        padding: 12px;
    }
    
    .tasa-indicator-unified {
        font-size: 0.75rem;
        padding: 6px 10px;
        gap: 6px;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .tasa-item {
        gap: 3px;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .result-value {
        font-size: 1.8rem;
    }
    
    .calculator-section, .result-section, .recipient-form {
        padding: 15px;
    }
}

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

.calculator-card {
    animation: fadeIn 0.6s ease-out;
}

/* Estados de carga */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Estilos para el banner informativo de PayPal */
.paypal-info-banner {
    background: linear-gradient(135deg, #0070ba, #003087);
    color: white;
    margin: 20px auto;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 112, 186, 0.3);
    overflow: hidden;
    animation: slideInDown 0.5s ease-out;
}

.paypal-info-content {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 15px;
}

.paypal-info-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.paypal-info-text {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

.paypal-info-text strong {
    color: #ffd700;
}

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

/* Responsive para el banner de PayPal */
@media (max-width: 768px) {
    .paypal-info-banner {
        margin: 15px 10px;
        border-radius: 8px;
    }
    
    .paypal-info-content {
        padding: 12px 15px;
        gap: 12px;
    }
    
    .paypal-info-text {
        font-size: 0.85rem;
    }
}

/* Sistema de Modales Personalizados */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.7) translateY(-50px);
    transition: all 0.3s ease;
}

.modal-overlay.show .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 20px 24px 0;
    text-align: center;
}

.modal-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.modal-icon.info {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.modal-icon.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.modal-icon.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.modal-icon.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.modal-icon.confirm {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.modal-body {
    padding: 16px 24px;
}

.modal-message {
    color: #6b7280;
    line-height: 1.6;
    text-align: center;
    margin-bottom: 20px;
}

.modal-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    margin-bottom: 16px;
}

.modal-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-footer {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.modal-btn.primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.modal-btn.primary:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
}

.modal-btn.secondary {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.modal-btn.secondary:hover {
    background: #e5e7eb;
    color: #4b5563;
}

.modal-btn.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.modal-btn.danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.modal-btn.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.modal-btn.success:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

/* Animaciones */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.7) translateY(-50px);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .modal-container {
        width: 95%;
        margin: 20px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
}