/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #c81e1e;
    --secondary-color: #1e3a8a;
    --accent-color: #dc2626;
    --danger-color: #991b1b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

/* Notification System */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.notification {
    background: white;
    border-left: 5px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 16px 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
    transform: translateX(400px);
    animation-fill-mode: forwards;
}

.notification.warning {
    border-left-color: #f59e0b;
}

.notification.error {
    border-left-color: var(--primary-color);
}

.notification.success {
    border-left-color: #10b981;
}

.notification.info {
    border-left-color: var(--secondary-color);
}

.notification-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    animation: bounceIn 0.6s ease-out;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.notification-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.notification.hiding {
    animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateX(400px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(400px);
    }
}

@keyframes bounceIn {
    0%, 20%, 40%, 60%, 80% {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    }
    0% {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }
    40% {
        transform: scale3d(0.9, 0.9, 0.9);
    }
    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }
    80% {
        transform: scale3d(0.97, 0.97, 0.97);
    }
    100% {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-image: url('assets/fondo.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Header */
header {
    background: white;
    color: var(--text-primary);
    padding: 40px 30px;
    text-align: center;
    border-bottom: 4px solid var(--primary-color);
}

header .logo {
    max-width: 250px;
    height: auto;
    margin-bottom: 20px;
    animation: fadeInDown 0.8s ease-out;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: var(--primary-color);
}

header h1 svg {
    flex-shrink: 0;
    fill: var(--primary-color);
}

header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Main Content */
main {
    padding: 40px 30px;
}

/* Form Sections */
.form-section {
    background: linear-gradient(135deg, rgba(248, 250, 252, 1) 0%, rgba(255, 255, 255, 1) 100%);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.form-section:hover {
    border-color: var(--secondary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.form-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h3 .icon {
    color: var(--secondary-color);
    flex-shrink: 0;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group label .icon {
    color: var(--primary-color);
    flex-shrink: 0;
}

.required {
    color: var(--primary-color);
}

/* Custom Select Wrapper for Universidad */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.styled-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: white;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    cursor: text;
    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='%23c81e1e' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
}

.styled-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(200, 30, 30, 0.1), var(--shadow-md);
    transform: translateY(-1px);
}

.custom-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 2px solid var(--primary-color);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: 0 8px 24px rgba(200, 30, 30, 0.15), 
                0 4px 12px rgba(200, 30, 30, 0.1),
                0 2px 6px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    margin-top: -2px;
    display: none;
}

.custom-dropdown.active {
    display: block;
}

/* Scrollbar personalizada */
.custom-dropdown::-webkit-scrollbar {
    width: 8px;
}

.custom-dropdown::-webkit-scrollbar-track {
    background: linear-gradient(to bottom, rgba(226, 232, 240, 0.3), rgba(226, 232, 240, 0.5));
    border-radius: 10px;
}

.custom-dropdown::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.custom-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--danger-color);
}

.custom-dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    font-size: 0.95rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: white;
}

.custom-dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.custom-dropdown-item:first-child {
    margin-top: 4px;
}

.custom-dropdown-item:hover {
    background: rgba(200, 30, 30, 0.1);
    padding-left: 18px;
    font-weight: 600;
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

.custom-dropdown-item.selected {
    background: rgba(200, 30, 30, 0.15);
    font-weight: 700;
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
    box-shadow: inset 0 0 10px rgba(200, 30, 30, 0.1);
}

.custom-dropdown-no-results {
    padding: 20px 15px;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

.custom-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: white;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.form-group input[type="text"] {
    cursor: text;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 512 512' fill='%2364748b'%3E%3Cpath d='M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 45px;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-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='%23c81e1e' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    padding-right: 40px;
}

.form-group select.styled-select option {
    padding: 12px 15px;
    margin: 5px 0;
    border-radius: 6px;
    background-color: white;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.5;
}

.form-group select.styled-select option:hover,
.form-group select.styled-select option:checked {
    background: rgba(200, 30, 30, 0.1);
    font-weight: 600;
}

.form-group select.styled-select option:first-child {
    color: var(--text-secondary);
    font-style: italic;
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(200, 30, 30, 0.1), var(--shadow-md);
    transform: translateY(-1px);
}

.form-group input[type="text"]::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.help-text {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 12px;
    background-color: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    border-color: var(--primary-color);
    background-color: rgba(220, 38, 38, 0.05);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label span {
    flex: 1;
    font-weight: 500;
}

/* Button */
.button-container {
    text-align: center;
    margin-top: 30px;
}

.btn-calculate {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 16px 60px;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(200, 30, 30, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-calculate::before {
    content: "🧮";
    margin-right: 8px;
    font-size: 1.2rem;
}

.btn-calculate::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-calculate:hover::after {
    width: 300px;
    height: 300px;
}

.btn-calculate:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(200, 30, 30, 0.6);
}

.btn-calculate:active {
    transform: translateY(-1px);
}

/* Results Container */
.results-container {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 3px solid var(--border-color);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-container h3 {
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 1.5rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.results-container h3 svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

/* Total Score Box */
.total-score-box {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 40px 30px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.total-score-box::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.total-label {
    font-size: 1.25rem;
    font-weight: 600;
    opacity: 0.95;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

.total-number {
    font-size: 4.5rem;
    font-weight: 700;
    margin: 15px 0;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.total-max {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* Score Breakdown */
.score-breakdown {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.score-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 1) 100%);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.score-item:hover {
    border-color: var(--secondary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.score-header h4 {
    color: var(--primary-color);
    font-size: 1.125rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-header h4::before {
    content: "📋";
    font-size: 1.2rem;
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #10b981;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.08) 100%);
    border-radius: 20px;
    border: 2px solid rgba(16, 185, 129, 0.3);
}

.score-details {
    background: linear-gradient(135deg, rgba(248, 250, 252, 1) 0%, rgba(255, 255, 255, 1) 100%);
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.8;
    border-left: 4px solid var(--secondary-color);
    box-shadow: var(--shadow-sm);
}

.score-details strong {
    color: var(--primary-color);
}

.score-max {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Info Box */
.info-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    padding: 18px 22px;
    border-radius: var(--border-radius);
    margin-top: 25px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.info-box::before {
    content: "⚠️";
    position: absolute;
    top: 10px;
    left: -30px;
    font-size: 4rem;
    opacity: 0.1;
}

.info-box p {
    margin: 0;
    color: #92400e;
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.info-box p strong {
    font-weight: 700;
    color: #78350f;
}

/* Footer */
footer {
    background-color: var(--bg-color);
    padding: 25px 30px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

footer p {
    margin: 5px 0;
}

footer a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

footer a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

footer .credits {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

footer .credits a {
    color: var(--primary-color);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

footer .credits a:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

footer .credits a::before {
    content: "📸";
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    #notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }

    .notification {
        padding: 12px 16px;
    }

    .notification-icon {
        font-size: 1.5rem;
    }

    .notification-title {
        font-size: 0.9rem;
    }

    .notification-message {
        font-size: 0.8rem;
    }

    .container {
        border-radius: 12px;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    header h2 {
        font-size: 1.25rem;
    }

    main {
        padding: 25px 20px;
    }

    .form-section {
        padding: 20px;
    }

    .total-number {
        font-size: 3rem;
    }

    .score-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.75rem;
    }

    header h2 {
        font-size: 1.125rem;
    }

    .btn-calculate {
        width: 100%;
        padding: 15px 30px;
    }

    .total-number {
        font-size: 2.5rem;
    }
}
