/**
 * Data Center Visitor Management System
 * Custom CSS Styles
 */

/* ===== General Styles ===== */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --gray-color: #95a5a6;
    --white-color: #ffffff;
    --black-color: #000000;
}

body {
    font-family: 'Roboto', sans-serif;
    color: #333;
    background-color: #f8f9fa;
    padding-top: 56px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ===== Navigation ===== */
.navbar {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 1);
}

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* ===== Cards ===== */
.card {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

.card-footer {
    background-color: rgba(0, 0, 0, 0.03);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Custom card border colors */
.border-left-primary {
    border-left: 4px solid var(--primary-color);
}

.border-left-success {
    border-left: 4px solid var(--success-color);
}

.border-left-warning {
    border-left: 4px solid var(--warning-color);
}

.border-left-danger {
    border-left: 4px solid var(--danger-color);
}

.border-left-info {
    border-left: 4px solid var(--info-color);
}

/* ===== Buttons ===== */
.btn {
    border-radius: 4px;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

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

.btn-success:hover {
    background-color: #27ae60;
    border-color: #27ae60;
}

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

.btn-danger:hover {
    background-color: #c0392b;
    border-color: #c0392b;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon i {
    margin-right: 0.5rem;
}

/* ===== Forms ===== */
.form-control {
    border-radius: 4px;
    border: 1px solid #ddd;
    padding: 0.75rem 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
    box-shadow: none;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.25);
}

.custom-file-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Tables ===== */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
}

.table th {
    font-weight: 600;
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.table-hover tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

/* ===== Badge ===== */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 600;
    font-size: 75%;
    border-radius: 0.25rem;
}

/* ===== Alerts ===== */
.alert {
    border: none;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background-color: rgba(46, 204, 113, 0.1);
    color: #27ae60;
}

.alert-danger {
    background-color: rgba(231, 76, 60, 0.1);
    color: #c0392b;
}

.alert-warning {
    background-color: rgba(243, 156, 18, 0.1);
    color: #e67e22;
}

.alert-info {
    background-color: rgba(52, 152, 219, 0.1);
    color: #2980b9;
}

/* ===== Progress Bars ===== */
.progress {
    height: 0.75rem;
    border-radius: 0.25rem;
    background-color: #ecf0f1;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    border-radius: 0.25rem;
    transition: width 0.6s ease;
}

/* ===== Lists ===== */
.list-group-item {
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.75rem 1.25rem;
}

.list-group-item:first-child {
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;
}

.list-group-item:last-child {
    border-bottom-left-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
}

/* ===== Webcam styles ===== */
#webcam-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #ddd;
    background-color: #000;
}

#webcam-video {
    width: 100%;
    height: auto;
    border-radius: 6px;
}

#photo-preview {
    margin-top: 20px;
}

#captured-image {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 2px solid #ddd;
}

/* ===== Custom Styles for Rack Visualization ===== */
.rack-container {
    background-color: #34495e;
    border-radius: 8px;
    padding: 15px;
    color: white;
    margin-bottom: 20px;
}

.rack-header {
    text-align: center;
    padding: 10px;
    background-color: #2c3e50;
    border-radius: 5px;
    margin-bottom: 10px;
}

.rack-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background-color: #7f8c8d;
    border-radius: 5px;
    padding: 5px;
}

.rack-unit {
    height: 25px;
    background-color: #bdc3c7;
    border-radius: 3px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    color: #333;
    transition: all 0.3s ease;
}

.rack-unit:hover {
    background-color: #ecf0f1;
}

.rack-unit.occupied {
    background-color: #3498db;
    color: white;
}

.rack-unit.maintenance {
    background-color: #f39c12;
    color: white;
}

.rack-unit.inactive {
    background-color: #95a5a6;
    color: white;
}

.rack-unit.failed {
    background-color: #e74c3c;
    color: white;
}

/* ===== Dashboard Stats ===== */
.dashboard-stat {
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.dashboard-stat:hover {
    transform: translateY(-5px);
}

.dashboard-stat .stat-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.dashboard-stat .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
}

.dashboard-stat .stat-label {
    font-size: 1rem;
    color: var(--gray-color);
    margin-top: 5px;
}

/* ===== Footer ===== */
footer {
    margin-top: 2rem;
    padding: 1rem 0;
    background-color: var(--dark-color);
    color: var(--white-color);
}

/* ===== Media Queries ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .card {
        margin-bottom: 1.5rem;
    }
    
    .dashboard-stat {
        margin-bottom: 1rem;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .jumbotron {
        padding: 2rem 1rem;
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes slideInFromLeft {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-in-left {
    animation: slideInFromLeft 0.5s ease-in-out;
}

@keyframes slideInFromRight {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-in-right {
    animation: slideInFromRight 0.5s ease-in-out;
}

/* ===== Print Styles ===== */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    body {
        font-size: 12pt;
        background-color: white !important;
        color: black !important;
    }
    
    .container {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    a {
        text-decoration: none !important;
        color: black !important;
    }
}