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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

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

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

.header-nav {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.header-nav a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    opacity: 0.9;
    transition: opacity 0.2s ease;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
}

.header-nav a:hover {
    opacity: 1;
    background: rgba(255,255,255,0.2);
}

.main-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    min-height: 70vh;
}

.form-panel {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    height: fit-content;
}

.form-panel h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.4rem;
}

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

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

button[type="submit"] {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.share-button {
    width: 100%;
    padding: 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.share-button:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
}

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

.visualization-panel {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
}

#sankey-container {
    width: 100%;
    height: 100%;
    min-height: 600px;
    position: relative;
}

.placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #666;
    text-align: center;
    padding: 40px;
}

.placeholder h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    max-width: 300px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: none;
}

.tooltip .amount {
    font-size: 16px;
    font-weight: bold;
    color: #4CAF50;
    display: block;
    margin: 5px 0;
}

.tooltip .amount small {
    font-size: 12px;
    font-weight: normal;
    color: #81C784;
    margin-left: 5px;
}

.tooltip .explanation {
    font-size: 12px;
    color: #ccc;
    display: block;
    margin-top: 8px;
}

.link {
    transition: stroke-opacity 0.2s ease;
}

.link:hover {
    stroke-opacity: 0.8 !important;
}

.node rect {
    transition: all 0.2s ease;
}

.node:hover rect {
    filter: brightness(1.1);
    stroke-width: 2px !important;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .form-panel {
        order: 2;
    }

    .visualization-panel {
        order: 1;
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    .form-panel {
        padding: 20px;
    }

    #sankey-container {
        min-height: 400px;
    }
}

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

    .form-panel {
        padding: 15px;
    }

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

    .form-group input,
    .form-group select {
        padding: 10px;
    }

    button[type="submit"] {
        padding: 12px;
        font-size: 14px;
    }
}

.sankey-node {
    cursor: pointer;
}

.sankey-link {
    cursor: pointer;
    stroke-opacity: 0.5;
}

.sankey-link:hover {
    stroke-opacity: 0.8;
}

svg text {
    font-family: inherit;
    pointer-events: none;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-size: 18px;
    color: #667eea;
}

.error {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-size: 16px;
    color: #d32f2f;
    text-align: center;
    padding: 20px;
}

/* Estilos para la página de información */
.info-content {
    max-width: 800px;
    margin: 0 auto;
}

.breadcrumb {
    margin-bottom: 20px;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.breadcrumb a:hover {
    opacity: 1;
    text-decoration: underline;
}

.info-panel {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    line-height: 1.7;
}

.info-panel h2 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
}

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

.info-section h3 {
    color: #667eea;
    font-size: 1.3rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-section p {
    color: #555;
    margin-bottom: 15px;
}

.info-section ul {
    color: #555;
    padding-left: 20px;
}

.info-section li {
    margin-bottom: 8px;
}

.info-section li strong {
    color: #333;
}

.info-section a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s ease;
}

.info-section a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.contact-email {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
    border-left: 4px solid #667eea;
}

.contact-email a {
    font-size: 1.2rem;
    font-weight: 600;
    color: #667eea;
    text-decoration: none;
}

.contact-email a:hover {
    text-decoration: underline;
}

.disclaimer {
    background: #fff3cd;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.disclaimer h3 {
    color: #856404;
    margin-bottom: 10px;
}

.disclaimer p {
    color: #856404;
    margin-bottom: 0;
}

.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin-top: 40px;
}

.cta-section h3 {
    color: white;
    margin-bottom: 15px;
}

.cta-section p {
    color: white;
    opacity: 0.9;
    margin-bottom: 20px;
}

.cta-button {
    display: inline-block;
    background: white;
    color: #667eea;
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Responsive para página de info */
@media (max-width: 768px) {
    .info-panel {
        padding: 25px;
        margin: 0 15px;
    }

    .info-panel h2 {
        font-size: 1.5rem;
    }

    .info-section h3 {
        font-size: 1.1rem;
    }

    .cta-section {
        padding: 20px;
        margin: 30px 15px 0;
    }
}