/* ============================================
   Projekt Abel V01.1 - Custom Styles
   Schneider IT & EDV-Technik
   ============================================ */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --sidebar-bg: #1e293b;
    --body-bg: #f1f5f9;
}

body {
    background-color: var(--body-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Login Page */
.login-body {
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 1rem;
}

.login-card {
    border: none;
    border-radius: 1rem;
}

.login-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-size: 2rem;
    font-weight: 700;
    border-radius: 1rem;
}

/* Navbar */
.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 0.5rem;
}

.navbar {
    padding: 0.5rem 1rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255,255,255,0.75);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    margin: 0 0.125rem;
    transition: all 0.2s;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: #fff;
    background-color: rgba(255,255,255,0.1);
}

/* Main Content */
.main-content {
    padding-top: 1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-bottom: 2rem;
    min-height: calc(100vh - 60px);
}

/* Stat Cards */
.stat-card {
    border-radius: 0.75rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.stat-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

/* Quick Cards */
.quick-card {
    border-radius: 0.75rem;
    transition: transform 0.2s, box-shadow 0.2s;
    color: #333;
}

.quick-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12) !important;
    color: var(--primary-color);
}

/* Cards */
.card {
    border-radius: 0.75rem;
    border: 1px solid rgba(0,0,0,0.08);
}

.card-header {
    border-radius: 0.75rem 0.75rem 0 0 !important;
    padding: 1rem 1.25rem;
}

/* Tables */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

.cursor-pointer {
    cursor: pointer;
}

.cursor-pointer:hover {
    background-color: #f8fafc !important;
}

/* Status Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Forms */
.form-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #374151;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

/* Footer */
.footer {
    background-color: #f8fafc !important;
}

/* Project Cards */
.project-card {
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

/* File Upload */
.upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fafc;
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background: #eff6ff;
}

/* Plan Items Table */
.plan-items-table {
    font-size: 0.9rem;
}

.plan-items-table th {
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .stat-icon {
        font-size: 1.25rem;
    }

    .stat-card h3 {
        font-size: 1.25rem;
    }
}

/* Print styles */
@media print {
    .sidebar, .sidebar-toggle, .sidebar-overlay, .footer, .btn, form {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding-top: 0 !important;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.3s ease-out;
}

/* Nav tabs custom */
.nav-tabs .nav-link {
    color: #64748b;
    border: none;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    background: transparent;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
}

/* Photo grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
}

.photo-grid img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.photo-grid img:hover {
    transform: scale(1.05);
}

/* LV totals */
.lv-total-row {
    background-color: #f0f9ff;
    font-weight: 700;
}

/* ============================================
   File Viewer Overlay
   ============================================ */
.file-viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

.file-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
}

.file-viewer-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    min-height: 56px;
}

.file-viewer-filename {
    flex: 1;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-viewer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    transition: background 0.15s;
    flex-shrink: 0;
}

.file-viewer-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.file-viewer-close {
    background: #dc3545;
    width: 48px;
    height: 48px;
    padding: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.file-viewer-close:hover {
    background: #bb2d3b;
}

.file-viewer-body {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.file-viewer-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.1s ease;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.file-viewer-body img:active {
    cursor: grabbing;
}

.file-viewer-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

.file-viewer-download-prompt {
    text-align: center;
    color: #fff;
}

.file-viewer-download-prompt i {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
    color: rgba(255, 255, 255, 0.6);
}

.file-viewer-download-prompt .file-viewer-dl-filename {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.file-viewer-download-prompt .file-viewer-dl-type {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1.5rem;
}

.file-viewer-download-prompt .btn {
    min-width: 200px;
}

.file-viewer-zoom-controls {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 0.5rem;
    padding: 0.25rem;
}

.file-viewer-zoom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: background 0.15s;
}

.file-viewer-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.file-viewer-zoom-level {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    user-select: none;
}
