:root {
    --bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --accent: #2563eb; /* Azul corporativo limpio */
    --code-bg: #f3f4f6;
    --border: #e5e7eb;
}

/* Modo oscuro automático si el usuario lo prefiere */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a0a0a;
        --text-primary: #ededed;
        --text-secondary: #a1a1a1;
        --accent: #60a5fa;
        --code-bg: #1a1a1a;
        --border: #262626;
    }
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 4rem 1rem;
}

.content {
    max-width: 680px;
    margin: 0 auto;
}

/* Header */
.main-header { margin-bottom: 4rem; }

.status-badge {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; font-weight: 600; letter-spacing: -0.02em; }

.role { 
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.contact-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    transition: 0.2s;
}

.contact-links a:hover { color: var(--accent); border-color: var(--accent); }

/* Secciones */
.section { margin-bottom: 3.5rem; }

.section-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

/* Stack Tecnológico */
.stack-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    font-size: 0.9rem;
}

.stack-item {
    background: var(--code-bg);
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* Experiencia */
.experience-item { margin-bottom: 2rem; }

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.company { font-weight: 600; font-size: 1.1rem; }

.period { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: var(--text-secondary); }

.exp-role { color: var(--accent); font-size: 0.95rem; margin-bottom: 0.5rem; }

ul { list-style: none; }

ul li::before {
    content: "→";
    color: var(--accent);
    margin-right: 8px;
    font-family: 'JetBrains Mono', monospace;
}

ul li { color: var(--text-secondary); margin-bottom: 0.4rem; padding-left: 0.5rem; }

/* Proyectos */
.project-card {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.project-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.project-card p { font-size: 0.9rem; color: var(--text-secondary); margin-top: 0.5rem; }

/* Footer */
.main-footer {
    margin-top: 6rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Botón de llamada SIP */
.sip-button {
    background: transparent;
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
    display: inline-block;
    position: relative;
    border: 2px solid transparent;
    overflow: hidden;
    z-index: 1;
}

.sip-button::before {
    content: '';
    position: absolute;
    top: -45px;
    left: -45px;
    right: -45px;
    bottom: -45px;
    background: conic-gradient(from 0deg, #10b981, #3b82f6, #ef4444, #10b981);
    z-index: -2;
    animation: gradientRotate 6s linear infinite;
    pointer-events: none;
}

.sip-button::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: var(--bg);
    z-index: -1;
    pointer-events: none;
}

@keyframes gradientRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.sip-button:hover::before {
    background: white;
    animation: none;
}

.sip-button:active {
    transform: translateY(1px);
}


.sip-button.in-call:hover::before {
    background: white;
    animation: none;
}


.sip-button.connecting {
    opacity: 0.6;
    cursor: not-allowed;
}

.call-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent);
    margin-top: 0.5rem;
    min-height: 1.2rem;
}

@media (max-width: 600px) {
    .stack-grid { grid-template-columns: 1fr; }
    .exp-header { flex-direction: column; }
}

.status-success {
    color: #10b981;
}

.status-error {
    color: #ef4444;
}

.status-warning {
    color: #f59e0b;
}

.status-info {
    color: var(--accent);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    animation: fadeIn 0.3s ease-in-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.modal-content {
    background-color: var(--bg);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    animation: slideDown 0.3s ease-out;
    border: 1px solid var(--border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: 0.2s;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Formulario */
form {
    padding: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    background-color: var(--code-bg);
    color: var(--text-primary);
    transition: 0.2s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    font-family: 'Inter', sans-serif;
}

/* Botones del formulario */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--code-bg);
    color: var(--text-primary);
}

/* Validación de formulario */
.form-error {
    display: block;
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 0.3rem;
    font-family: 'JetBrains Mono', monospace;
}

.form-group input.invalid {
    border-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.05);
}

/* Indicador de llamada en progreso */
.call-indicator {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
    border-radius: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    color: white;
}

.call-indicator.hidden {
    display: none;
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    0% {
        width: 30px;
        height: 30px;
        opacity: 1;
    }
    100% {
        width: 100px;
        height: 100px;
        opacity: 0;
    }
}

.call-duration {
    position: relative;
    z-index: 2;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
    margin-top: 0.5rem;
}

/* Barras de volumen */
.volume-meters {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--code-bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.volume-meters.hidden {
    display: none;
}

.meter-container {
    margin-bottom: 1rem;
}

.meter-container:last-child {
    margin-bottom: 0;
}

.meter-container label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meter {
    width: 100%;
    height: 8px;
    background-color: var(--border);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.meter-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #3b82f6, #ef4444);
    width: 0%;
    transition: width 0.1s ease-out;
    border-radius: 4px;
}

@media (max-width: 600px) {
    .call-indicator {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .call-duration {
        font-size: 1.2rem;
    }
    
    .pulse-ring {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        max-width: none;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}
