/* Hosting Management System - Main Stylesheet */

/* CSS Variables */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --warning-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --info-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --dark-gradient: linear-gradient(135deg, #a8a8a8 0%, #636363 100%);
}

/* Global Styles */
body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Login Page Specific */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

/* Navigation */
.navbar {
    background: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
    border-bottom: 1px solid #e9ecef;
}

.navbar-brand {
    font-weight: 700;
    color: #667eea !important;
}

.user-info {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 0.5rem 1rem;
}

/* Sidebar Navigation */
.sidebar {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,.07);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.nav-link {
    color: #6c757d;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.nav-link:hover, .nav-link.active {
    background: var(--primary-gradient);
    color: white !important;
    transform: translateX(5px);
    text-decoration: none;
}

/* Header Section */
.header-section {
    background: var(--primary-gradient);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-radius: 0 0 30px 30px;
}

/* Cards */
.stat-card, .app-detail-card, .config-card, .log-viewer-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,.08);
    border: none;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before, .app-detail-card::before, .config-card::before, .log-viewer-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--primary-gradient);
}

.stat-card.success::before, .app-detail-card.running::before { 
    background: var(--success-gradient); 
}

.stat-card.warning::before, .app-detail-card.stopped::before { 
    background: var(--warning-gradient); 
}

.stat-card.info::before { 
    background: var(--info-gradient); 
}

.stat-card:hover, .app-detail-card:hover, .config-card:hover, .log-viewer-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,.12);
}

/* Status Cards */
.stat-card {
    padding: 1.5rem;
}

/* Icons */
.stat-icon, .app-icon, .config-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    font-size: 1.5rem;
}

.app-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    font-size: 2.5rem;
}

.config-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    font-size: 1.5rem;
}

.stat-icon.primary, .app-icon.cigar, .config-icon.ssl { 
    background: var(--primary-gradient); 
}

.stat-icon.success, .app-icon.tobacco, .config-icon.nginx { 
    background: var(--success-gradient); 
}

.stat-icon.warning, .config-icon.systemd { 
    background: var(--warning-gradient); 
}

.stat-icon.info { 
    background: var(--info-gradient); 
}

/* Status Badges */
.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
}

.status-running {
    background: var(--success-gradient);
    color: white;
}

.status-stopped {
    background: var(--warning-gradient);
    color: white;
}

.status-unknown {
    background: var(--dark-gradient);
    color: white;
}

/* Status Indicators */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

.status-indicator.running, .status-indicator.valid { 
    background: #38ef7d; 
}

.status-indicator.stopped, .status-indicator.invalid { 
    background: #f5576c; 
}

.status-indicator.unknown { 
    background: #a8a8a8; 
}

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

/* Progress Bars */
.progress {
    height: 8px;
    border-radius: 10px;
}

/* Buttons */
.btn-action, .btn-app-action, .btn-log-action, .btn-config-action {
    border-radius: 10px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.btn-action:hover, .btn-app-action:hover, .btn-log-action:hover, .btn-config-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,.15);
}

.btn-start, .btn-success { 
    background: var(--success-gradient); 
    color: white; 
}

.btn-stop, .btn-danger { 
    background: var(--warning-gradient); 
    color: white; 
}

.btn-restart, .btn-primary { 
    background: var(--primary-gradient); 
    color: white; 
}

.btn-info { 
    background: var(--info-gradient); 
    color: white; 
}

/* Application Cards */
.app-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,.07);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.app-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,.1);
}

/* Activity Items */
.activity-item {
    padding: 1rem;
    border-left: 3px solid #667eea;
    background: white;
    border-radius: 0 10px 10px 0;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

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

/* Log Viewer */
.filter-panel {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid #667eea;
}

.log-entry {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    padding: 0.75rem;
    border-left: 3px solid #e9ecef;
    margin-bottom: 0.5rem;
    background: #fafafa;
    border-radius: 0 8px 8px 0;
    transition: all 0.2s ease;
}

.log-entry:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.log-entry.error {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.log-entry.error:hover {
    background: #fed7d7;
}

.log-entry.warn {
    border-left-color: #ffc107;
    background: #fffbf0;
}

.log-entry.warn:hover {
    background: #fef5e7;
}

.log-entry.info {
    border-left-color: #0dcaf0;
    background: #f0fcff;
}

.log-entry.info:hover {
    background: #e6f7ff;
}

.log-entry.debug {
    border-left-color: #6c757d;
    background: #f8f9fa;
}

.log-timestamp {
    color: #6c757d;
    font-weight: 600;
    margin-right: 1rem;
}

.log-level {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 1rem;
    text-transform: uppercase;
}

.log-level.error {
    background: #dc3545;
    color: white;
}

.log-level.warn {
    background: #ffc107;
    color: #212529;
}

.log-level.info {
    background: #0dcaf0;
    color: white;
}

.log-level.debug {
    background: #6c757d;
    color: white;
}

.log-message {
    color: #212529;
}

.log-container {
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: 10px;
    padding: 1rem;
    max-height: 600px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.4;
}

.log-container::-webkit-scrollbar {
    width: 8px;
}

.log-container::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Configuration Management */
.config-item {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.config-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,.1);
}

.editor-container {
    background: #1e1e1e;
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 1rem;
    min-height: 400px;
}

.CodeMirror {
    height: 400px;
    border-radius: 10px;
    font-size: 14px;
}

.config-stats, .file-info, .metric-box {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.file-info {
    background: rgba(102, 126, 234, 0.1);
    border-left: 4px solid #667eea;
}

.metric-box {
    border-left: 4px solid #667eea;
}

/* Source Badge */
.source-badge {
    background: var(--info-gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Chart Container */
.chart-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,.07);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* Login Page Specific */
.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo-section {
    background: var(--primary-gradient);
    border-radius: 20px 0 0 20px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 3rem;
}

.logo-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.form-section {
    padding: 3rem;
}

.form-control {
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.btn-login {
    background: var(--primary-gradient);
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: white;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.feature-list i {
    margin-right: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo-section {
        border-radius: 20px 20px 0 0;
        padding: 2rem;
    }
    
    .form-section {
        padding: 2rem;
    }
    
    .stat-card, .app-detail-card, .config-card, .log-viewer-container {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .sidebar {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .header-section {
        padding: 1.5rem 0;
    }
}

/* Utility Classes */
.text-monospace {
    font-family: 'Courier New', monospace;
}

.opacity-75 {
    opacity: 0.75;
}

/* Toast Notifications */
.toast {
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

/* Animations */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-up {
    animation: slideInUp 0.3s ease-out;
}

/* Print Styles */
@media print {
    .navbar, .sidebar, .btn-action, .btn-app-action, .btn-log-action, .btn-config-action {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .stat-card, .app-detail-card, .config-card, .log-viewer-container {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}
