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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-content {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    position: relative;
}

.header-text {
    flex: 1;
    text-align: center;
    min-width: 300px;
    padding-left: 20px;
}

.header-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.header-logo:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.logo {
    max-width: 100px;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

header h1 {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 10px;
}

header h1 i {
    color: #f39c12;
    margin-right: 15px;
}

header p {
    font-size: 1.2em;
    color: #7f8c8d;
}

/* Responsive design para el header */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .header-text {
        min-width: auto;
        padding-left: 0;
        order: 2;
    }
    
    .header-logo {
        order: 1;
        align-self: center;
        padding: 12px;
    }
    
    .logo {
        max-width: 80px;
        max-height: 80px;
    }
    
    header h1 {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    .header-logo {
        padding: 10px;
    }
    
    .logo {
        max-width: 70px;
        max-height: 70px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    header p {
        font-size: 1em;
    }
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 15px 30px;
    font-size: 1.1em;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: #7f8c8d;
    font-weight: 500;
}

.tab-btn:hover {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.tab-btn.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.tab-btn i {
    margin-right: 8px;
}

/* Tab Content */
.tab-content {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

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

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.section-header h2 {
    color: #2c3e50;
    font-size: 1.8em;
}

.section-header h2 i {
    color: #3498db;
    margin-right: 10px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-controls label {
    font-weight: 500;
    color: #2c3e50;
    white-space: nowrap;
}

.filter-controls select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    font-size: 0.9em;
    min-width: 200px;
}

.filter-controls select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 8px 12px;
    font-size: 0.9em;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 8px 12px;
    font-size: 0.9em;
    margin-right: 5px;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    padding: 8px 12px;
    font-size: 0.9em;
    margin-right: 5px;
}

.btn-info:hover {
    background: linear-gradient(135deg, #138496, #117a8b);
}

/* Form */
.form-container {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
}

.form-title {
    font-size: 1.4em;
    font-weight: 600;
    margin-bottom: 20px;
    padding: 10px 15px;
    border-radius: 8px;
    text-align: center;
}

.form-title.add-mode {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.form-title.edit-mode {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
}

table tbody tr:hover {
    background: #f8f9fa;
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* Summary Cards */
.summary-card {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.3);
}

.summary-card h3 {
    margin-bottom: 20px;
    font-size: 1.5em;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.summary-item .label {
    font-weight: 500;
}

.summary-item .value {
    font-weight: bold;
    font-size: 1.2em;
}

/* Comparison Grid */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.comparison-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #3498db;
}

.comparison-card.difference {
    border-left-color: #e74c3c;
    background: linear-gradient(135deg, #fff5f5, #ffe6e6);
}

.comparison-card h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.comparison-card h3 i {
    margin-right: 10px;
}

.comparison-metrics {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.metric-label {
    font-weight: 500;
    color: #2c3e50;
}

.metric-value {
    font-weight: bold;
    font-size: 1.1em;
    color: #27ae60;
}

.comparison-card.difference .metric-value {
    color: #e74c3c;
}

/* Estilos para métricas máximas */
.metric[id*="max"] {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border-left: 4px solid #ffc107;
    padding-left: 16px !important;
    margin: 4px 0;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
}

.metric[id*="max"] .metric-label {
    font-weight: bold;
    color: #856404;
    font-size: 0.9em;
}

.metric[id*="max"] .metric-value {
    color: #856404;
    font-weight: bold;
    font-size: 1.0em;
}

/* Transformador Details */
.transformador-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 6px;
    margin: 5px 0;
    font-size: 0.9em;
}

.transformador-detail .transformador-name {
    font-weight: 500;
}

.transformador-detail .transformador-kva {
    font-weight: bold;
    color: #3498db;
}

/* Estilos para valores máximos en barras de consumo */
.consumption-value {
    text-align: right;
    font-weight: bold;
}

.consumption-value div:first-child {
    color: #2c3e50;
    font-size: 1em;
}

.consumption-value div:last-child {
    color: #856404;
    font-size: 0.8em;
    margin-top: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        margin: 2px 0;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        justify-content: center;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 0.9em;
    }
    
    table th,
    table td {
        padding: 10px 8px;
    }
}

/* Animations */
.btn,
.tab-btn,
.form-group input,
.form-group select {
    transition: all 0.3s ease;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success/Error messages */
.message {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Estados de transformadores */
.critical {
    color: #e74c3c;
    font-weight: bold;
}

.high {
    color: #f39c12;
    font-weight: bold;
}

.medium {
    color: #f1c40f;
    font-weight: bold;
}

.low {
    color: #27ae60;
    font-weight: bold;
}

.positive {
    color: #27ae60;
}

.negative {
    color: #e74c3c;
}

/* Indicador de sincronización */
.sync-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
    z-index: 1000;
    animation: slideInRight 0.3s ease;
}

.sync-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.sync-content i {
    font-size: 1.2em;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Estado de conexión Firebase */
.firebase-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
    z-index: 1000;
}

.firebase-status.connected {
    background: #27ae60;
    color: white;
}

.firebase-status.disconnected {
    background: #e74c3c;
    color: white;
}

.firebase-status.connecting {
    background: #f39c12;
    color: white;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 20px;
}

.filter-controls label {
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
}

.filter-controls select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.9em;
    min-width: 250px;
    background: white;
    transition: border-color 0.3s ease;
}

.filter-controls select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Transformer Visualization */
.transformer-visualization {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #dee2e6;
}

.transformer-visualization h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.6em;
    text-align: center;
}

.transformer-visualization h3 i {
    color: #3498db;
    margin-right: 10px;
}

.visualization-content {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 30px;
    align-items: start;
}

.transformer-info {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.transformer-info h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.capacity-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border-radius: 8px;
    font-weight: bold;
}

.capacity-label {
    font-size: 1.1em;
}

.capacity-value {
    font-size: 1.3em;
}

.consumption-bars {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.consumption-item {
    margin-bottom: 25px;
}

.consumption-item:last-child {
    margin-bottom: 0;
}

.consumption-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
}

.consumption-value {
    font-weight: bold;
    color: #27ae60;
}

.progress-bar {
    width: 100%;
    height: 25px;
    background: #ecf0f1;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 1.5s ease-in-out;
    position: relative;
    overflow: hidden;
}

.progress-fill.installed {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.progress-fill.projected {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.progress-fill.total {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.utilization-info {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.utilization-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #ecf0f1;
}

.utilization-metric:last-child {
    border-bottom: none;
}

.utilization-metric .metric-label {
    font-weight: 600;
    color: #2c3e50;
}

.utilization-metric .metric-value {
    font-weight: bold;
    font-size: 1.1em;
}

/* Responsive para visualización */
@media (max-width: 768px) {
    .visualization-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .filter-controls select {
        min-width: auto;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .tabs,
    .btn,
    .form-container,
    .sync-indicator,
    .firebase-status,
    .filter-controls,
    .transformer-visualization {
        display: none;
    }
    
    .tab-content {
        display: block !important;
        box-shadow: none;
        background: white;
    }
}

/* Estilos para vista agrupada por transformador */
.transformer-header {
    transition: background-color 0.3s ease;
}

.transformer-header:hover {
    background-color: #e9ecef !important;
}

.transformer-chevron {
    transition: transform 0.3s ease;
    margin-right: 8px;
}

.transformer-details {
    animation: slideDown 0.3s ease-out;
}

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

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.analysis-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.analysis-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.equipment-list {
    margin-top: 15px;
}

.equipment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    margin: 8px 0;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #007bff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.equipment-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 3px;
}

/* Grupos de botones */
.btn-group {
    display: inline-flex;
    gap: 5px;
    padding: 5px;
    background: rgba(0,0,0,0.05);
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
}

.btn-group .btn {
    margin: 0;
    font-size: 12px;
    padding: 6px 10px;
}

/* Pie de página */
.footer {
    margin-top: 40px;
    padding: 20px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

.footer i {
    margin-right: 8px;
    color: #ffd700;
}

.footer strong {
    color: #ffd700;
    font-weight: 600;
}

/* Estilos para la sección de fórmulas eléctricas */
.formulas-container {
    display: grid;
    gap: 25px;
    margin-top: 20px;
}

.formula-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #3498db;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.formula-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2980b9, #27ae60, #f39c12);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.formula-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.formula-card:hover::before {
    opacity: 1;
}

.formula-card h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4em;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.formula-card h3 i {
    margin-right: 12px;
    color: #3498db;
    font-size: 1.2em;
}

.formula-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.formula-equation {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #dee2e6;
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.formula-equation::before {
    content: '⚡';
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5em;
    color: #f39c12;
    opacity: 0.3;
}

.formula-equation strong {
    color: #2c3e50;
    background: linear-gradient(135deg, #3498db, #27ae60);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.formula-explanation {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.formula-explanation h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.formula-explanation h4::before {
    content: '📋';
    margin-right: 8px;
}

.formula-explanation ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.formula-explanation li {
    margin-bottom: 12px;
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.formula-explanation li:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.formula-explanation li strong {
    color: #e74c3c;
    font-weight: 700;
}

.formula-explanation p {
    margin: 15px 0;
    line-height: 1.6;
    color: #2c3e50;
}

.formula-explanation p strong {
    color: #27ae60;
    font-weight: 600;
}

/* Estilos especiales para diferentes tipos de fórmulas */
.formula-card:nth-child(1) {
    border-left-color: #3498db;
}

.formula-card:nth-child(2) {
    border-left-color: #27ae60;
}

.formula-card:nth-child(3) {
    border-left-color: #e74c3c;
}

.formula-card:nth-child(4) {
    border-left-color: #f39c12;
}

.formula-card:nth-child(5) {
    border-left-color: #9b59b6;
}

.formula-card:nth-child(6) {
    border-left-color: #1abc9c;
}

.formula-card:nth-child(7) {
    border-left-color: #34495e;
}

.formula-card:nth-child(8) {
    border-left-color: #e67e22;
}

/* Iconos específicos para cada tipo de fórmula */
.formula-card:nth-child(1) h3 i {
    color: #3498db;
}

.formula-card:nth-child(2) h3 i {
    color: #27ae60;
}

.formula-card:nth-child(3) h3 i {
    color: #e74c3c;
}

.formula-card:nth-child(4) h3 i {
    color: #f39c12;
}

.formula-card:nth-child(5) h3 i {
    color: #9b59b6;
}

.formula-card:nth-child(6) h3 i {
    color: #1abc9c;
}

.formula-card:nth-child(7) h3 i {
    color: #34495e;
}

.formula-card:nth-child(8) h3 i {
    color: #e67e22;
}

/* Responsive para fórmulas */
@media (max-width: 768px) {
    .formulas-container {
        gap: 20px;
    }
    
    .formula-card {
        padding: 20px;
    }
    
    .formula-card h3 {
        font-size: 1.2em;
    }
    
    .formula-equation {
        padding: 15px;
        font-size: 1em;
    }
    
    .formula-explanation {
        padding: 15px;
    }
    
    .formula-explanation li {
        padding: 8px 12px;
    }
}

/* Animaciones para las fórmulas */
@keyframes formulaFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.formula-card {
    animation: formulaFadeIn 0.6s ease-out;
}

.formula-card:nth-child(1) { animation-delay: 0.1s; }
.formula-card:nth-child(2) { animation-delay: 0.2s; }
.formula-card:nth-child(3) { animation-delay: 0.3s; }
.formula-card:nth-child(4) { animation-delay: 0.4s; }
.formula-card:nth-child(5) { animation-delay: 0.5s; }
.formula-card:nth-child(6) { animation-delay: 0.6s; }
.formula-card:nth-child(7) { animation-delay: 0.7s; }
.formula-card:nth-child(8) { animation-delay: 0.8s; }

/* Estilos para botones PDF en transformadores */
.btn-pdf-transformer {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
    min-width: 60px;
    justify-content: center;
}

.btn-pdf-transformer:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

.btn-pdf-transformer:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

.btn-pdf-transformer i {
    font-size: 0.9em;
}

/* Prevenir que el clic en el botón PDF active el toggle del transformador */
.btn-pdf-transformer {
    z-index: 10;
    position: relative;
}

/* Estilos adicionales para mejorar la interacción */
.transformer-header .btn-pdf-transformer {
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.transformer-header:hover .btn-pdf-transformer {
    opacity: 1;
}

/* Responsive para botones PDF */
@media (max-width: 768px) {
    .btn-pdf-transformer {
        padding: 4px 8px;
        font-size: 0.7em;
        min-width: 50px;
    }
    
    .btn-pdf-transformer i {
        font-size: 0.8em;
    }
}

/* Search Container */
.search-container {
    margin: 20px 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 0 20px;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-box i.fa-search {
    color: #6c757d;
    margin-right: 12px;
    font-size: 1.1em;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 15px 0;
    font-size: 1em;
    background: transparent;
    color: #495057;
}

.search-box input::placeholder {
    color: #adb5bd;
    font-style: italic;
}

.clear-search {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    margin-left: 10px;
}

.clear-search:hover {
    background: #f8f9fa;
    color: #dc3545;
}

.search-results-info {
    margin-top: 10px;
    padding: 8px 15px;
    font-size: 0.9em;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 20px;
    display: none;
}

.search-results-info.show {
    display: block;
}

.search-results-info.has-results {
    color: #28a745;
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.search-results-info.no-results {
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
}

/* Highlight matched text in search results */
.search-highlight {
    background: #fff3cd;
    color: #856404;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Responsive para búsqueda */
@media (max-width: 768px) {
    .search-container {
        margin: 15px 0;
        padding: 12px;
    }
    
    .search-box {
        padding: 0 15px;
    }
    
    .search-box input {
        padding: 12px 0;
        font-size: 0.9em;
    }
    
    .search-box input::placeholder {
        font-size: 0.85em;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: white;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 800px;
    animation: modalFadeIn 0.3s ease;
}

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

.modal-body {
    padding: 20px;
}

.transformer-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #3498db;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transformer-item-info {
    flex: 1;
}

.transformer-item-actions {
    display: flex;
    gap: 10px;
}

/* Diccionario Técnico Styles */
.header-actions-main {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-left: auto;
}

.dictionary-term {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
}

.dictionary-term:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.dictionary-term h3 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dictionary-term h3 i {
    color: #3498db;
}

.dictionary-category {
    margin-bottom: 30px;
}

.dictionary-category h2 {
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.dictionary-formula {
    background: #e8f4f8;
    padding: 15px;
    border-radius: 6px;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    border-left: 3px solid #3498db;
}

.dictionary-description {
    color: #555;
    line-height: 1.6;
    margin: 10px 0;
}

.dictionary-units {
    background: #fff3cd;
    padding: 8px 12px;
    border-radius: 4px;
    display: inline-block;
    margin: 5px 0;
    font-size: 0.9em;
    color: #856404;
}

.dictionary-example {
    background: #d1ecf1;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
    border-left: 3px solid #17a2b8;
    font-size: 0.95em;
}

.dictionary-hidden {
    display: none !important;
}

.dictionary-calculator {
    background: #f0f8ff;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border: 2px solid #3498db;
}

.dictionary-calculator h4 {
    margin-top: 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dictionary-calculator .calc-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.95em;
    transition: border-color 0.3s ease;
}

.dictionary-calculator .calc-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.calculator-result {
    margin-top: 15px;
    padding: 12px;
    background: #e8f5e9;
    border-radius: 6px;
    border-left: 4px solid #4caf50;
    animation: slideIn 0.3s ease;
}

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

.calculator-result strong {
    color: #2c3e50;
}

.calculator-result span {
    color: #1b5e20;
    font-weight: bold;
    font-size: 1.1em;
}
