@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* --- Reset y Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f5f5f7;
    min-height: 100vh;
    padding: 20px;
    color: #1d1d1f;
}

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

@keyframes fadeInModal {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* --- Container Principal --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* --- Header --- */
.header {
    background: linear-gradient(135deg,  #5856d6 0%, #e7eef6 100%);
    color: white;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.header-logo { height: 50px; width: auto; }
.header-content { flex: 1; }
.header h1 { font-size: 20px; font-weight: 600; margin-bottom: 2px; line-height: 1.2; }
.header p { opacity: 0.9; font-size: 11px; line-height: 1.2; }

.beta-ribbon {
    position: absolute;
    top: 22px;
    right: -35px;
    width: 130px;
    background: #5856d6;
    color: white;
    padding: 3px 0;
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transform: rotate(45deg);
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 100;
    pointer-events: none;
}

/* --- Contenido Principal --- */
.calc-content {
    padding: 40px;
}

/* --- Selector de Calculadora --- */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 32px;
}

.custom-select {
    display: block;
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    line-height: 1.5;
    color: #1d1d1f;
    background-color: #ffffff;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 3rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.custom-select:hover {
    border-color: #86868b;
}

.custom-select:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.custom-select-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    fill: #64748b;
    width: 20px;
    height: 20px;
}

/* --- Secciones de Calculadora --- */
.calculator-section {
    background-color: #fafafa;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    padding: 32px;
    display: none;
    transition: all 0.4s ease-in-out;
    border: 1px solid #e5e5e7;
}

.calculator-section.active {
    display: block;
    animation: fadeIn 0.5s ease-out forwards;
}

.calculator-section h2 {
    color: #1d1d1f;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 24px;
}

/* --- Input Groups --- */
.input-group {
    margin-bottom: 24px;
}

.input-group label {
    font-weight: 600;
    color: #48484a;
    margin-bottom: 8px;
    display: block;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Preserve mixed-case for specific abbreviations inside labels (e.g. hPa, inHg, mmHg, km/h) */
.preserve-case {
    text-transform: none;
}

.input-group input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    font-size: 16px;
    color: #1d1d1f;
    transition: all 0.2s ease;
    background-color: #ffffff;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.input-group input:hover {
    border-color: #86868b;
}

.input-group input:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

/* Mejora de foco para accesibilidad */
button:focus, .custom-select:focus, input:focus {
    outline: 3px solid rgba(0, 122, 255, 0.18);
    outline-offset: 2px;
}

.input-group .text-xs {
    font-size: 12px;
    color: #86868b;
    margin-top: 6px;
}

/* --- Botones --- */
.button-primary {
    background: #007aff;
    color: white;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.25);
    letter-spacing: 0.3px;
    font-family: 'Inter', sans-serif;
    width: 100%;
}

.button-primary:hover {
    background: #0051d5;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.35);
}

.button-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
}

/* Botón secundario/ghost para acciones opcionales (ej. Copiar) */
.button-ghost {
    background: transparent;
    color: #1d1d1f;
    border: 1px solid #d2d2d7;
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-right: 8px;
}

.button-ghost:hover {
    background: #f3f4f6;
    border-color: #c7c7cc;
}

/* --- Textos Explicativos --- */
.explanation-text {
    font-size: 13px;
    color: #64748b;
    margin-top: 24px;
    line-height: 1.6;
    background-color: #f8fafc;
    padding: 16px;
    border-radius: 10px;
    border: 1px dashed #e2e8f0;
}

.warning-text {
    font-size: 13px;
    color: #dc2626;
    margin-top: 16px;
    text-align: center;
    font-weight: 600;
    background-color: #ffebee;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #ef9a9a;
}

/* --- Message Box --- */
.message-box {
    background-color: #ffebee;
    color: #d32f2f;
    border: 1px solid #ef9a9a;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 24px;
    text-align: center;
    font-weight: 600;
    display: none;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.1);
}

/* --- Modal --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.show,
.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeInModal 0.3s ease;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    animation: slideUpModal 0.4s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid #e5e5e7;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0;
}

.modal-close {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 24px;
    color: #1d1d1f;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.modal-body {
    padding: 32px;
}

.modal-result {
    background: #f5f5f7;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e5e7;
}

.modal-result .result-label {
    font-size: 14px;
    color: #86868b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    text-align: center;
}

.modal-result .result-value {
    font-size: 48px;
    font-weight: 700;
    color: #007aff;
    text-align: center;
    line-height: 1.2;
}

.modal-footer {
    padding: 20px 32px;
    border-top: 1px solid #e5e5e7;
    display: flex;
    justify-content: flex-end;
}

.modal-footer .button-primary {
    width: auto;
    min-width: 120px;
}

/* --- Footer --- */
.footer { 
    background: #fafafa; 
    border-top: 1px solid #e5e5e7; 
    padding: 20px;
    min-height: 50px;
}

.footer-content { 
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 1600px;
    margin: 0 auto;
    flex-wrap: wrap;
}
/* Perfil de X - Mayor especificidad para evitar conflictos */
.footer .material-profile {
    display: inline-flex !important;
    align-items: center !important;
    text-decoration: none;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    color: #1d1d1f;
    vertical-align: middle; /* Añadido para mejor alineación */
}

.footer .material-profile .bi-twitter-x {
    display: block;
    flex-shrink: 0;
    width: 16px; /* Tamaño fijo para el SVG */
    height: 16px;
}

.footer .material-profile .username {
    line-height: 1;
    font-size: 10px;
    font-weight: 500;
    color: #86868b;
}

/* Asegurar que el enlace no afecte el layout */
.footer a.material-profile:hover .username {
    color: #0051d5;
}
.footer-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer h3 { 
    font-size: 11px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer p { 
    font-size: 10px; 
    margin: 0; 
    color: #86868b;
    line-height: 1.5;
}

.footer a {
    color: #007aff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: #0051d5;
    text-decoration: underline;
}

.footer-copyright {
    text-align: right;
}

/* --- RESPONSIVE --- */

/* Tablets */
@media (max-width: 1024px) {
    .calc-content {
        padding: 32px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .calculator-section {
        padding: 28px;
    }
}

/* Tablets pequeños */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
    
    .container {
        border-radius: 0;
    }
    
    .header {
        padding: 20px 24px;
    }
    
    .header-logo {
        height: 50px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .header p {
        font-size: 12px;
    }
    
    .calc-content {
        padding: 24px;
    }
    
    .calculator-section {
        padding: 24px;
    }
    
    .calculator-section h2 {
        font-size: 20px;
    }
    
    .footer {
        padding: 24px;
    }
    
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .footer-copyright {
        text-align: left;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 16px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px 24px;
    }
}

/* Móviles */
@media (max-width: 480px) {
    .header {
        padding: 16px 20px;
    }
    
    .header-logo {
        height: 40px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .header p {
        font-size: 11px;
    }
    
    .calc-content {
        padding: 20px;
    }
    
    .calculator-section {
        padding: 20px;
        border-radius: 12px;
    }
    
    .calculator-section h2 {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .input-group {
        margin-bottom: 20px;
    }
    
    .input-group label {
        font-size: 12px;
    }
    
    .input-group input,
    .custom-select {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .button-primary {
        padding: 14px 24px;
        font-size: 14px;
    }
    
    .explanation-text,
    .warning-text {
        font-size: 12px;
        padding: 12px;
    }
    
    .footer {
        padding: 20px;
    }
    
    .footer h3 {
        font-size: 10px;
    }
    
    .footer p {
        font-size: 11px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .modal-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px 20px;
    }
}

/* Scrollbar personalizada */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f5f5f7;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #d2d2d7;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #86868b;
}
.material-profile {
    display: inline-flex;  /* Activa el modo alineación flexible */
    align-items: center;   /* Centra verticalmente el logo y el texto entre sí */
    text-decoration: none; /* Quita el subrayado del enlace */
    gap: 8px;              /* Controla la separación exacta entre el logo y el texto */
    
    /* Estética Material opcional */
    font-family: sans-serif;
    color: #000;           /* Color del texto y logo */
}

/* Estilo para el SVG (logo) */
.bi-twitter-x {
    display: block;        /* Evita espacios extra debajo del icono */
    flex-shrink: 0;        /* Evita que el logo se deforme si hay poco espacio */
}

/* Estilo para el texto */
.username {
    line-height: 1;        /* Elimina espacios sobrantes por encima/debajo del texto */
    font-size: 10px;       /* Ajusta al tamaño que prefieras */
    font-weight: 500;      /* Peso medio estilo Material */
}