/* Loxone Backup Manager - Modernes, responsives CSS */

:root {
    --primary: #007bff;
    --primary-dark: #0056b3;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --secondary: #6c757d;
    --light: #f8f9fa;
    --dark: #333;
    --border: #dee2e6;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--dark);
    background: var(--light);
}

/* Navbar */
.navbar {
    background: var(--dark);
    color: white;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 20px;
    font-weight: 600;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
}

.nav-logout {
    background: var(--danger);
}

.nav-logout:hover {
    background: #c82333;
}

.nav-user {
    padding: 8px 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    cursor: pointer;
}

.dropdown-arrow {
    font-size: 10px;
    margin-left: 5px;
    transition: transform 0.3s;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--dark);
    min-width: 200px;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    margin-top: 5px;
    z-index: 1000;
    padding: 5px 0;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-item {
    display: block;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    transition: background 0.2s;
}

.nav-dropdown-item:hover {
    background: rgba(255,255,255,0.1);
}

.nav-dropdown-divider {
    height: 1px;
    background: rgba(255,255,255,0.2);
    margin: 5px 0;
}

/* Main Container */
.main-container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 30px;
    min-height: calc(100vh - 200px);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-color: var(--success);
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border-color: var(--danger);
    color: #721c24;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

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

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

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

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

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

.btn-secondary:hover {
    background: #5a6268;
}

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

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 13px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Forms */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 800px;
}

.form-group {
    margin-bottom: 20px;
    flex: 1;
}

.form-row {
    display: flex;
    gap: 20px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

small {
    display: block;
    margin-top: 5px;
    color: var(--secondary);
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

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

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 13px;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

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

.table thead {
    background: var(--dark);
    color: white;
}

.table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.table tbody tr:hover {
    background: var(--light);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    margin-left: 5px;
}

.badge-cloud {
    background: #0dcaf0;
    color: white;
}

.badge-local {
    background: var(--secondary);
    color: white;
}

.badge-inactive {
    background: var(--warning);
    color: var(--dark);
}

/* Status */
.status-success {
    color: var(--success);
    font-weight: 600;
}

.status-failed {
    color: var(--danger);
    font-weight: 600;
}

.text-muted {
    color: var(--secondary);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 5px;
}

/* Login */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    margin-bottom: 10px;
    text-align: center;
}

.login-subtitle {
    text-align: center;
    color: var(--secondary);
    margin-bottom: 30px;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--secondary);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

/* Empty State */
.empty-state {
    background: white;
    padding: 60px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.empty-state p {
    margin-bottom: 20px;
    color: var(--secondary);
}

/* Footer */
.footer {
    background: white;
    padding: 20px;
    text-align: center;
    margin-top: 60px;
    border-top: 1px solid var(--border);
    color: var(--secondary);
    font-size: 13px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
}