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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(88, 86, 214, 0.3) 0%, transparent 50%);
    animation: gradientShift 15s ease infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gradientShift {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: -1px;
    position: relative;
    z-index: 1;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.5));
    }
    to {
        filter: drop-shadow(0 0 20px rgba(118, 75, 162, 0.8));
    }
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: #e0e0e0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.calculator {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 100px rgba(102, 126, 234, 0.1);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form {
    padding: 40px;
    border-right: 1px solid #e0e0e0;
}

.form-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.4rem;
    color: #667eea;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

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

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

.input-field {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

select.input-field {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

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

.pension-value {
    display: block;
    margin-top: 8px;
    font-weight: 600;
    color: #667eea;
    font-size: 0.95rem;
}

/* Grupo de aumento salarial */
.salary-increase-group {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.increase-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-increase {
    flex: 1;
}

.btn-increase {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-increase:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

.btn-increase i {
    font-size: 1rem;
}

.increase-result {
    display: block;
    margin-top: 10px;
    font-weight: 700;
    color: #27ae60;
    font-size: 1rem;
    text-align: center;
    padding: 8px;
    background: rgba(39, 174, 96, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.btn-calculate {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin-bottom: 10px;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

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

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.btn-save {
    padding: 16px;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.6);
}

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

.btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-admin {
    padding: 16px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}

.btn-admin:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.6);
}

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

.results {
    padding: 40px;
    background: linear-gradient(180deg, #f8f9ff 0%, #ffffff 100%);
}

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

.result-card.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.result-label {
    font-size: 1rem;
    margin-bottom: 10px;
    opacity: 0.9;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
}

.breakdown {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.breakdown-title {
    font-size: 1.2rem;
    color: #667eea;
    margin-bottom: 20px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 1rem;
}

.breakdown-item.deduction .breakdown-value {
    color: #e74c3c;
}

.breakdown-item.positive .breakdown-value {
    color: #27ae60;
}

.breakdown-item.total {
    font-weight: 700;
    font-size: 1.1rem;
    color: #667eea;
}

.breakdown-label {
    color: #555;
}

.breakdown-value {
    font-weight: 600;
    color: #333;
}

.breakdown-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
    margin: 15px 0;
}

.footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 30px;
    padding: 20px;
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 0.5px;
}

@media (max-width: 968px) {
    .calculator {
        grid-template-columns: 1fr;
    }

    .form {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .header {
        padding: 30px 15px;
    }

    .header h1 {
        font-size: 2.2rem;
        letter-spacing: -0.5px;
    }

    .subtitle {
        font-size: 1rem;
    }

    .result-value {
        font-size: 2rem;
    }

    .button-group {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .btn-calculate,
    .btn-save,
    .btn-admin {
        font-size: 1rem;
        padding: 14px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    body::before {
        animation: gradientShift 20s ease infinite;
    }

    .form,
    .results {
        padding: 20px 15px;
    }

    .header {
        padding: 25px 10px;
        margin-bottom: 20px;
    }

    .header h1 {
        font-size: 1.8rem;
        letter-spacing: 0;
        margin-bottom: 10px;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    .input-field {
        font-size: 0.95rem;
        padding: 10px 14px;
    }

    .result-value {
        font-size: 1.6rem;
    }

    .result-label {
        font-size: 0.9rem;
    }

    .breakdown-title {
        font-size: 1.1rem;
    }

    .breakdown-item {
        font-size: 0.9rem;
        padding: 10px 0;
    }

    .btn-calculate,
    .btn-save,
    .btn-admin {
        font-size: 0.95rem;
        padding: 12px;
    }

    .button-group {
        gap: 8px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
        max-height: 90vh;
    }

    .modal-content.modal-small {
        width: 90%;
    }

    .profile-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .btn-load-profile {
        width: 100%;
    }

    .footer {
        font-size: 0.8rem;
        padding: 15px;
    }

    .calculator {
        border-radius: 15px;
    }
}

@media (max-width: 360px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .result-value {
        font-size: 1.4rem;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-content.modal-small {
    max-width: 400px;
}

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

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

.close, .close-profile {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover, .close-profile:hover {
    color: #667eea;
}

.modal-section {
    margin-top: 20px;
}

.modal-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.profiles-list {
    display: grid;
    gap: 10px;
}

.profile-item {
    background: #f8f9ff;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.profile-item:hover {
    border-color: #667eea;
    transform: translateX(5px);
}

.profile-info h4 {
    color: #333;
    margin-bottom: 5px;
}

.profile-info p {
    color: #666;
    font-size: 0.85rem;
}

.btn-load-profile {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-load-profile:hover {
    background: #5568d3;
    transform: scale(1.05);
}

.btn-confirm {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: #999;
}

.empty-state p {
    margin: 0;
}