@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --accent: #f093fb;
    --accent-2: #f5576c;
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #ef4444;
    --info: #3b82f6;
    --light: #f8f9fa;
    --dark: #1e293b;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    padding: 20px;
    color: #333;
    line-height: 1.6;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.main-with-sidebar {
    min-height: 100vh;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Styles */
header {
    background: var(--gradient-2);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.1"><circle cx="30" cy="30" r="2"/></g></svg>');
    animation: float 20s linear infinite;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

header h1 {
    font-size: 3em;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

.header-actions {
    margin-top: 20px;
    position: relative;
    z-index: 1;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-standar-link {
    display: inline-block;
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-standar-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.header-icon {
    font-size: 4em;
    margin-bottom: 20px;
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Main Content */
.main-content {
    padding: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Section Styles */
section {
    background: var(--light);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

section:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

section h2 {
    color: var(--primary);
    margin-bottom: 25px;
    font-size: 1.8em;
    font-weight: 700;
    border-bottom: 4px solid var(--primary);
    padding-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

section h2::before {
    content: '';
    width: 5px;
    height: 30px;
    background: var(--gradient-1);
    border-radius: 3px;
}

/* Form Styles */
.form-group {
    margin-bottom: 25px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--dark);
    font-weight: 600;
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label::before {
    content: '▶';
    color: var(--primary);
    font-size: 0.8em;
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
    font-family: 'Poppins', sans-serif;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

.form-group input:hover {
    border-color: var(--primary-dark);
}

.form-group small {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-size: 0.85em;
    font-style: italic;
    padding-left: 20px;
}

/* Button Styles */
.btn-calculate, .btn-reset, .btn-print {
    width: 100%;
    padding: 18px;
    margin-top: 15px;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-calculate::before, .btn-reset::before, .btn-print::before {
    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::before, .btn-reset:hover::before, .btn-print:hover::before {
    width: 300px;
    height: 300px;
}

.btn-calculate {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-reset {
    background: var(--gradient-2);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.btn-print {
    background: var(--gradient-3);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.btn-calculate:hover, .btn-reset:hover, .btn-print:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-calculate:active, .btn-reset:active, .btn-print:active {
    transform: translateY(-1px) scale(0.98);
}

/* Standard Section */
.standard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.standard-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid var(--primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.standard-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.standard-item:hover::before {
    left: 100%;
}

.standard-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
    border-left-color: var(--accent);
}

.standard-item label {
    display: block;
    color: var(--dark);
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.standard-value {
    font-size: 1.4em;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.standard-item small {
    color: #64748b;
    font-size: 0.8em;
    display: block;
    padding-top: 5px;
    border-top: 1px solid #e2e8f0;
}

/* Result Section */
.result-section {
    grid-column: 1 / -1;
    animation: fadeIn 0.8s ease-out;
}

.result-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-md);
    border-left: 6px solid var(--primary);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1), transparent);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-left-width: 8px;
}

.result-card h3 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-card h3::before {
    content: '▸';
    color: var(--accent);
    font-size: 1.2em;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s ease;
}

.result-item:hover {
    background: rgba(102, 126, 234, 0.05);
    padding-left: 10px;
    border-radius: 5px;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item label {
    color: var(--dark);
    font-weight: 600;
    flex: 1;
}

.result-value {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2em;
    text-align: right;
    flex: 1;
}

.result-status {
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9em;
    text-align: center;
    animation: pulse 2s ease-in-out infinite;
}

.result-status.success {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: white;
}

.result-status.warning {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.result-status.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

/* Images */
.image-container {
    text-align: center;
    margin: 30px 0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.image-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.image-container:hover img {
    transform: scale(1.05);
}

.info-box {
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    border-left: 5px solid var(--info);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.info-box h4 {
    color: var(--info);
    margin-bottom: 10px;
    font-size: 1.2em;
}

.info-box p {
    color: var(--dark);
    line-height: 1.8;
}

.link-standar {
    display: inline-block;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    padding: 10px 15px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.link-standar:hover {
    background: var(--gradient-1);
    color: white;
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

/* Footer */
footer {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    text-align: center;
    padding: 30px;
    margin-top: 40px;
}

footer p {
    font-size: 1em;
    opacity: 0.9;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .btn-calculate, .btn-reset, .btn-print {
        display: none;
    }
    
    section {
        page-break-inside: avoid;
    }
    
    .result-card {
        border: 1px solid #ddd;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2.5em;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 30px 20px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .main-content {
        padding: 20px;
        gap: 20px;
    }
    
    section {
        padding: 20px;
    }
    
    section h2 {
        font-size: 1.5em;
    }
    
    .standard-grid {
        grid-template-columns: 1fr;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .result-value {
        text-align: left;
        width: 100%;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }
    
    .header-icon {
        font-size: 3em;
    }
    
    .btn-calculate, .btn-reset, .btn-print {
        padding: 15px;
        font-size: 1em;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-1);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}
