:root {
    --bg-color: #0f1115;
    --panel-bg: rgba(25, 28, 36, 0.7);
    --panel-border: rgba(255, 255, 255, 0.08);
    --primary-color: #e63946;
    --primary-hover: #f0545f;
    --text-main: #ffffff;
    --text-muted: #a0a5b1;
    --accent-color: #457b9d;
    --success-color: #2a9d8f;
    --font-family: 'Outfit', sans-serif;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(230, 57, 70, 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(69, 123, 157, 0.05), transparent 25%);
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.view {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.view.active {
    display: block;
    opacity: 1;
    animation: fadeIn 0.5s ease forwards;
}

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

/* --- Login View --- */
#login-view {
    height: 100vh;
    padding: 20px;
}
#login-view.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    text-align: center;
    border-radius: 16px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.logo i { font-size: 2.5rem; }
.logo h1 { font-size: 2.5rem; font-weight: 700; color: var(--text-main); }
.logo.small i { font-size: 1.5rem; }
.logo.small h2 { font-size: 1.5rem; color: var(--text-main); margin-bottom: 0;}

.login-container p { color: var(--text-muted); margin-bottom: 30px; }

.input-group { position: relative; margin-bottom: 20px; }
.input-group i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.input-group input {
    width: 100%; padding: 15px 15px 15px 45px; background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--panel-border); border-radius: 10px; color: var(--text-main);
    font-family: inherit; font-size: 1rem; transition: var(--transition);
}
.input-group input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.2); }

.btn-primary {
    width: 100%; padding: 15px; background: var(--primary-color); color: white;
    border: none; border-radius: 10px; font-size: 1.1rem; font-weight: 600; cursor: pointer;
    transition: var(--transition); font-family: inherit;
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(230, 57, 70, 0.4); }

.mock-note { margin-top: 20px; font-size: 0.8rem; color: var(--text-muted); background: rgba(255,255,255,0.05); padding: 8px; border-radius: 6px; }

/* --- Dashboard View --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    position: sticky;
    top: 0;
    z-index: 100;
    /* Removed border radius to attach completely to the top */
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
    width: 100%;
}

.user-profile { display: flex; align-items: center; gap: 15px; }

.btn-icon {
    background: rgba(255,255,255,0.05); border: 1px solid var(--panel-border); color: var(--text-main);
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer; transition: var(--transition);
}
.btn-icon:hover { background: var(--primary-color); border-color: var(--primary-color); }

.dashboard-content { max-width: 1000px; margin: 0 auto; padding: 40px 20px; }

.dashboard-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 40px; gap: 20px; flex-wrap: wrap; }
.header-text h2 { font-size: 2rem; margin-bottom: 8px; }
.header-text p { color: var(--text-muted); }

.search-bar { display: flex; align-items: center; padding: 10px 20px; flex: 1; max-width: 400px; border-radius: 30px; }
.search-bar i { color: var(--text-muted); margin-right: 10px; }
.search-bar input { background: transparent; border: none; color: white; width: 100%; font-size: 1rem; font-family: inherit; }
.search-bar input:focus { outline: none; }

/* --- Timeline & Cards (ODS) --- */
.timeline-container { display: flex; flex-direction: column; gap: 30px; position: relative; }
.timeline-container::before { content: ''; position: absolute; left: 20px; top: 0; bottom: 0; width: 2px; background: var(--panel-border); z-index: 0; }

.timeline-item { display: flex; gap: 30px; position: relative; z-index: 1; animation: slideIn 0.5s ease backwards; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }

.timeline-date { min-width: 120px; text-align: right; padding-top: 15px; }
.timeline-date .day-month { font-size: 1.2rem; font-weight: 700; color: var(--text-main); }
.timeline-date .year { color: var(--primary-color); font-size: 0.9rem; font-weight: 600; }

.timeline-marker {
    width: 42px; height: 42px; background: var(--bg-color); border: 2px solid var(--primary-color);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: var(--primary-color); flex-shrink: 0; box-shadow: 0 0 10px rgba(230, 57, 70, 0.3);
}

.ods-card {
    flex: 1; padding: 25px; transition: var(--transition); border-radius: 16px; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
}
.ods-card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,0.3); box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4); }

.ods-info h3 { font-size: 1.5rem; display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.ods-info h3 i { color: var(--primary-color); }
.ods-info p { color: var(--text-muted); font-size: 0.9rem; }

.ods-action {
    display: flex; align-items: center; gap: 15px;
}

.status-badge {
    padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600;
    background: rgba(42, 157, 143, 0.2); color: var(--success-color); border: 1px solid rgba(42, 157, 143, 0.3);
}
.view-details-btn {
    background: var(--primary-color); color: white; width: 40px; height: 40px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    border: none; transition: var(--transition);
}
.ods-card:hover .view-details-btn { background: var(--primary-hover); transform: translateX(5px); }

/* --- Modals --- */
.modal {
    display: none; position: fixed; z-index: 200; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.8); backdrop-filter: blur(5px);
}

.modal-card {
    margin: 5% auto; width: 90%; max-width: 800px; border-radius: 16px;
    max-height: 85vh; display: flex; flex-direction: column;
}

.modal-header {
    padding: 20px 25px; border-bottom: 1px solid var(--panel-border);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { font-size: 1.4rem; }

.close-modal { color: var(--text-muted); font-size: 28px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.close-modal:hover { color: var(--primary-color); }

.modal-body {
    padding: 25px; overflow-y: auto; display: flex; flex-direction: column; gap: 20px;
}

/* Extinguisher detail item inside modal */
.ext-detail-item {
    display: flex; flex-direction: column; gap: 15px; padding: 20px; 
    background: rgba(0,0,0,0.2); border-radius: 12px; border: 1px solid var(--panel-border);
}

.ext-info { width: 100%; }
.ext-info h4 { font-size: 1.2rem; color: var(--primary-color); margin-bottom: 8px; display: flex; align-items: center; gap: 8px;}
.ext-info .type-badge {
    display: inline-block; padding: 3px 8px; background: rgba(255,255,255,0.1);
    border-radius: 4px; font-size: 0.8rem; margin-bottom: 10px;
}
.ext-info p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; }

.photos-gallery {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
    /* Custom scrollbar for gallery */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(0,0,0,0.2);
}

.photos-gallery::-webkit-scrollbar { height: 8px; }
.photos-gallery::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 4px; }
.photos-gallery::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 4px; }

.ext-photo {
    width: 140px; height: 140px; border-radius: 8px; overflow: hidden;
    flex-shrink: 0; cursor: pointer; position: relative;
}
.ext-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.ext-photo:hover img { transform: scale(1.1); }
.ext-photo::after {
    content: '\f00e'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
    position: absolute; inset: 0; background: rgba(0,0,0,0.5); display: flex;
    align-items: center; justify-content: center; color: white; font-size: 1.5rem;
    opacity: 0; transition: opacity 0.3s ease;
}
.ext-photo:hover::after { opacity: 1; }
.ext-info h4 { font-size: 1.2rem; color: var(--primary-color); margin-bottom: 8px; display: flex; align-items: center; gap: 8px;}
.ext-info .type-badge {
    display: inline-block; padding: 3px 8px; background: rgba(255,255,255,0.1);
    border-radius: 4px; font-size: 0.8rem; margin-bottom: 10px;
}
.ext-info p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; }

/* Photo Fullscreen Modal */
.photo-modal {
    display: none; position: fixed; z-index: 1000; padding-top: 50px;
    left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.9);
}
.photo-modal-content { margin: auto; display: block; max-width: 90%; max-height: 80vh; border-radius: 8px; animation: zoom 0.3s ease; }
.close-photo-modal { position: absolute; top: 20px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.close-photo-modal:hover { color: var(--primary-color); }
#modal-caption { margin: auto; display: block; width: 80%; text-align: center; color: #ccc; padding: 15px 0; font-size: 1.2rem; }

/* Responsive */
@media (max-width: 768px) {
    .timeline-container::before { left: 20px; }
    .timeline-item { flex-direction: column; gap: 15px; padding-left: 50px; position: relative; }
    .timeline-date { text-align: left; padding-top: 0; }
    .timeline-date .day-month { display: inline-block; margin-right: 10px; }
    .timeline-date .year { display: inline-block; }
    .timeline-marker { position: absolute; left: 0; top: 0; }
    
    .ods-card { flex-direction: column; align-items: flex-start; gap: 15px; }
    .ods-action { width: 100%; justify-content: space-between; }
    
    .ext-photo { width: 120px; height: 120px; }
}
