/* Customer Portal Dashboard Styles */

:root {
    --primary-color: #2a5298;
    --primary-light: #3a62b8;
    --primary-dark: #1a4288;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --dark-text: #333;
    --border-color: #dee2e6;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.6;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

.loading-content {
    text-align: center;
}

.loading-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Auth Screen */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    padding: 20px;
}

.auth-container {
    background: white;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.auth-header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: #666;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.auth-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.3s;
}

.auth-btn:hover {
    background: var(--primary-dark);
}

.auth-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    color: #666;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 5px;
    margin-top: 1rem;
    text-align: center;
}

/* Dashboard */
.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.dashboard-header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-left i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.header-left h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.customer-name {
    background: var(--light-bg);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.9rem;
    color: #666;
}

.header-right {
    display: flex;
    gap: 1rem;
}

.action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.action-btn:hover {
    transform: translateY(-1px);
}

.zabbix-btn {
    background: var(--success-color);
    color: white;
}

.zabbix-btn:hover {
    background: #218838;
}

.action-btn:not(.zabbix-btn) {
    background: var(--light-bg);
    color: var(--dark-text);
    border: 1px solid var(--border-color);
}

.action-btn:not(.zabbix-btn):hover {
    background: #e9ecef;
}

/* Main Content */
.dashboard-main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Stats Section */
.stats-section {
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    background: var(--primary-color);
}

.stat-icon.status-ok {
    background: var(--success-color);
}

.stat-icon.status-problem {
    background: var(--danger-color);
}

.stat-icon.status-pending {
    background: var(--warning-color);
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: #666;
    font-size: 0.9rem;
}

/* Sections */
.hosts-section,
.problems-section {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
}

.section-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Hosts Table */
.hosts-table-container {
    overflow-x: auto;
}

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

.hosts-table th,
.hosts-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.hosts-table th {
    background: var(--light-bg);
    font-weight: 600;
    color: var(--dark-text);
}

.hosts-table tr:hover {
    background: #f8f9fa;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-ok {
    background: #d4edda;
    color: #155724;
}

.status-problem {
    background: #f8d7da;
    color: #721c24;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-unknown {
    background: #e2e3e5;
    color: #6c757d;
}

/* No Data Message */
.no-data-message {
    text-align: center;
    padding: 3rem 2rem;
    color: #666;
}

.no-data-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-data-message h3 {
    margin-bottom: 0.5rem;
}

.no-data-message p {
    margin-bottom: 1.5rem;
}

/* Problems List */
.problems-list {
    padding: 1rem 2rem;
}

.problem-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-left: 4px solid var(--danger-color);
    background: #fff5f5;
    border-radius: 0 5px 5px 0;
    margin-bottom: 1rem;
}

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

.problem-severity {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: var(--danger-color);
}

.problem-content h4 {
    margin-bottom: 0.25rem;
    color: var(--dark-text);
}

.problem-content p {
    color: #666;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .dashboard-main {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .hosts-table {
        font-size: 0.9rem;
    }
    
    .hosts-table th,
    .hosts-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .auth-container {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .auth-container {
        padding: 1.5rem;
    }
}