/* Estilos para AppTallerMaster */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #ecf0f1;
    color: #2c3e50;
    line-height: 1.6;
}

header {
    background: linear-gradient(135deg, #35424a 0%, #1a252f 100%);
    color: #ffffff;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    text-align: left;
}

.header-left h1 {
    font-size: 2.5em;
    margin-bottom: 5px;
    margin: 0;
}

.header-left p {
    font-size: 1.1em;
    opacity: 0.9;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    font-size: 0.95em;
    opacity: 0.9;
}

#username {
    font-weight: bold;
    color: #3498db;
}

.logout-btn {
    padding: 8px 16px;
    background-color: rgba(231, 76, 60, 0.9);
    color: #ffffff;
    border: 1px solid #e74c3c;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background-color: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }

    .header-left {
        text-align: center;
    }

    .header-left h1 {
        font-size: 1.8em;
    }

    .header-right {
        width: 100%;
        justify-content: center;
    }
}

/* Navbar */
.navbar {
    background-color: #2c3e50;
    padding: 0;
    display: flex;
    gap: 0;
    overflow-x: auto;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: none;
    color: #ecf0f1;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    min-width: 150px;
}

.nav-btn:hover {
    background-color: #34495e;
}

.nav-btn.active {
    background-color: #3498db;
    border-bottom-color: #2980b9;
    color: #ffffff;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    min-height: calc(100vh - 300px);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Cards */
.card {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.card h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.card h3 {
    color: #34495e;
    margin-bottom: 15px;
}

.card h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.card.full-width {
    margin-top: 20px;
}

/* Dashboard */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.health-card,
.metric-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.metric-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #3498db;
    margin-top: 10px;
}

/* Health Meter */
.health-meter {
    width: 100%;
    height: 30px;
    background-color: #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
    margin: 10px 0;
    position: relative;
}

.health-bar {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #f39c12, #f1c40f, #2ecc71);
    width: 0%;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
}

.health-bar.excellent {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.health-bar.good {
    background: linear-gradient(90deg, #f39c12, #e67e22);
}

.health-bar.fair {
    background: linear-gradient(90deg, #e67e22, #e74c3c);
}

.health-bar.poor {
    background: linear-gradient(90deg, #c0392b, #e74c3c);
}

#health-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Databases Grid */
.databases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.db-card {
    border-left: 5px solid #3498db;
}

.db-card.status-connected {
    border-left-color: #27ae60;
}

.db-card.status-disconnected {
    border-left-color: #e74c3c;
    background-color: #fef5f5;
}

.db-card p {
    margin: 8px 0;
    font-size: 0.95em;
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: bold;
}

.db-card.status-connected .status-badge {
    background-color: #d5f4e6;
    color: #27ae60;
}

.db-card.status-disconnected .status-badge {
    background-color: #fadbd8;
    color: #e74c3c;
}

.error-text {
    color: #e74c3c;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    background-color: #fef5f5;
    padding: 3px 6px;
    border-radius: 3px;
    display: inline-block;
}

.status-group {
    margin-bottom: 30px;
}

.error-row {
    background-color: #fef5f5;
    border-left: 4px solid #e74c3c;
}

.error-table {
    margin-top: 15px;
}

.success-metric {
    color: #27ae60;
    font-weight: bold;
}

.error-metric {
    color: #e74c3c;
    font-weight: bold;
}

.evaluation-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.evaluation-item {
    border: 1px solid #ecf0f1;
    padding: 15px;
    border-radius: 5px;
    background-color: #f8f9fa;
}

.evaluation-item h4 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.health-indicator {
    width: 100%;
    height: 60px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
    color: #ffffff;
    font-weight: bold;
    font-size: 1.5em;
}

.health-indicator.excellent {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.health-indicator.good {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.health-indicator.fair {
    background: linear-gradient(135deg, #e67e22, #e74c3c);
}

.health-indicator.poor {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
}

.small-table {
    width: 100%;
    font-size: 0.95em;
    border-collapse: collapse;
}

.small-table tr {
    border-bottom: 1px solid #ecf0f1;
}

.small-table tr:hover {
    background-color: #f8f9fa;
}

.small-table td {
    padding: 8px;
    text-align: left;
}

.small-table td:first-child {
    font-weight: 600;
    width: 60%;
    color: #34495e;
}

.small-table td:last-child {
    color: #3498db;
    font-weight: 500;
    text-align: right;
}

/* Indicadores */
.indicator-db {
    margin-bottom: 30px;
}

.indicator-section {
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

.indicator-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
}

.indicator-section h5 {
    color: #34495e;
    margin: 10px 0;
}

.indicator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.indicator-card {
    background: #ffffff;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: 3px solid #3498db;
    transition: transform 0.2s ease;
}

.indicator-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.indicator-card.success {
    border-left-color: #27ae60;
}

.indicator-card.error {
    border-left-color: #e74c3c;
}

.indicator-card.warning {
    border-left-color: #f39c12;
}

.indicator-label {
    font-size: 0.85em;
    color: #7f8c8d;
    font-weight: 600;
    text-transform: uppercase;
}

.indicator-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #2c3e50;
}

.indicator-value-small {
    font-size: 0.9em;
    color: #34495e;
    font-weight: 500;
}

.alert-error {
    background-color: #fadbd8;
    border-left: 4px solid #e74c3c;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 4px;
}

/* Tables */
.summary-table,
.report-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.summary-table tr,
.report-table tr {
    border-bottom: 1px solid #ecf0f1;
}

.summary-table tr:hover,
.report-table tr:hover {
    background-color: #f8f9fa;
}

.summary-table td,
.report-table th,
.report-table td {
    padding: 12px;
    text-align: left;
}

.report-table th {
    background-color: #34495e;
    color: #ffffff;
    font-weight: bold;
}

.summary-table td:first-child {
    font-weight: 600;
    width: 60%;
}

.summary-table td:last-child,
.report-table td:last-child {
    text-align: right;
    color: #3498db;
    font-weight: 500;
}

/* Report Container */
.report-container {
    padding: 20px 0;
}

.report-container h3 {
    margin-top: 25px;
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.report-container h3:first-child {
    margin-top: 0;
}

/* Metrics Container */
.metrics-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.metric-detail {
    border-left: 4px solid #9b59b6;
}

.metric-detail p {
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
}

.metric-detail p strong {
    flex: 0 0 auto;
    margin-right: 10px;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 20px;
    margin-top: 50px;
    font-size: 0.9em;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }

    .header-left {
        text-align: center;
    }

    .header-left h1 {
        font-size: 1.8em;
    }

    .header-right {
        width: 100%;
        justify-content: center;
    }

    .dashboard {
        grid-template-columns: repeat(2, 1fr);
    }

    .databases-grid {
        grid-template-columns: 1fr;
    }

    .nav-btn {
        font-size: 0.9em;
        min-width: 100px;
    }

    .container {
        padding: 0 10px;
    }

    .card {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .nav-btn {
        font-size: 0.8em;
        padding: 10px;
    }

    .header-container h1 {
        font-size: 1.5em;
    }
}