﻿﻿html {
    font-size: 14px;
    position: relative;
    min-height: 100vh;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin: 0;
    /* padding-top: 60px; */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.fade-out {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.fade-in {
    opacity: 1;
    transition: opacity 0.6s ease;
}

/* Card Enhancements - Basic hover effects only */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

    .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    }

/* Button Styling */
.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

    .btn-primary:hover {
        background-color: #155a9b;
        border-color: #124d87;
        transform: scale(1.05);
    }

/* Card Text Consistency */
.card-text {
    min-height: 100px;
    text-align: center;
    color: #333333 !important;
}

.card-title {
    text-align: center;
    color: #333333 !important;
    font-weight: 600;
}

/* Responsive Card Column Flex */
.row > div {
    display: flex;
}

.card {
    flex: 1;
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 70vh; /* Base height for mobile and smaller tablets (prevents clipping) */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

@media (min-width: 992px) { /* Applies to standard desktop screens and larger */
    .hero-section {
        min-height: 60vh; /* Your preferred desktop height */
    }
}

.bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

    .bg-video.active {
        opacity: 1;
    }

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    max-width: 80%;
}

/* Section Padding */
.section {
    padding: 60px 0;
}

/* Footer */
.footer {
    background-color: #1a1a1a;
    color: #ccc;
    font-size: 0.9rem;
    padding: 3rem 0 0; /* Guests: full padding */
    width: 100%;
    flex-shrink: 0;
}

    .footer.logged-in {
        padding: 1rem 0 1.0rem !important; /* Logged in: minimal */
        min-height: auto !important;
    }

    .footer a {
        color: #aaa;
        text-decoration: none;
        transition: color 0.2s ease;
    }

        .footer a:hover {
            color: #fff !important;
        }

    .footer .logo img {
        max-height: 50px;
    }

    .footer .contact-info p {
        margin: 0.25rem 0;
        font-size: 0.9rem;
    }

    .footer .list-unstyled li {
        margin-bottom: 0.5rem;
    }

    .footer .divider {
        border-top: 1px solid #333;
        margin: 2rem 0 1rem;
    }
    /* Center contact info block */
    .footer .contact-info {
        max-width: 600px;
        margin: 0 auto;
        text-align: center;
    }

    /* Footer column headers */
    .footer h6 {
        font-weight: 600;
        font-size: 1rem;
        margin-bottom: 1rem;
        text-transform: uppercase;
    }

    /* Footer column spacing */
    .footer .row > div {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Divider line */
    .footer hr.bg-secondary,
    .footer .divider {
        border-top: 1px solid #444;
        margin: 2rem 0 1rem;
    }

    /* Status bar layout */
    .footer .status-bar {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        font-size: 0.9rem;
        padding: 1rem 0;
        border-top: 1px solid #333;
        text-align: center;
    }

    @media (min-width: 768px) {
        .footer .status-bar {
            flex-direction: row;
            justify-content: space-between;
            text-align: left;
        }

        .footer .contact-info {
            text-align: left;
        }
    }

    /* Link hover polish */
    .footer a:hover {
        color: #ffc107 !important; /* Bootstrap warning yellow */
        text-decoration: underline;
    }

/* Main Content */
main {
    flex: 1 0 auto;
}

/* Navbar Enhancements */
.navbar {
    background: #2A2A2A;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    padding: 15px 20px;
    z-index: 1000;
    position: fixed;
    top: 0;
    width: 100%;
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: 700;
    color: #FFFFFF !important;
    transition: transform 0.2s ease, color 0.2s ease;
}

    .navbar-brand:hover {
        color: #FFCC00 !important;
        transform: scale(1.05);
    }

.nav-link {
    color: #FFFFFF !important;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

    .nav-link:hover {
        background-color: #333333;
        transform: scale(1.05);
    }

    .nav-link.active {
        background-color: #404040;
        color: #FFFFFF !important;
    }

.navbar-toggler {
    border: none;
    padding: 8px;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.9)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-collapse {
    justify-content: flex-end;
}

/* Responsive Adjustments */
@media (max-width: 767px) {
    .hero-section, .section {
        padding: 1rem 0;
    }

    .hero-section {
        height: 60vh;
    }

        .hero-section .display-4 {
            font-size: 2rem;
        }

        .hero-section .fs-5 {
            font-size: 1.1rem;
        }

        .hero-section img {
            max-height: 250px;
        }

    .navbar-brand {
        font-size: 1.5rem;
    }

    .nav-link {
        padding: 8px 10px;
        font-size: 1rem;
    }

    .navbar-collapse {
        background: #2A2A2A;
        padding: 10px;
        border-radius: 5px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .navbar-brand {
        font-size: 1.6rem;
    }
}

@media (min-width: 992px) {
    .hero-section img {
        max-height: 400px;
    }
}

/* Define custom variable */
:root {
    --bg-light: #f8f9fa;
}

.img-btn {
    max-width: 200px;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 576px) {
    .img-btn {
        max-width: 150px;
        margin-left: auto;
        margin-right: auto;
    }
}

.img-btn-2 {
    max-width: 150px;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 576px) {
    .img-btn-2 {
        max-width: 100px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Increased spacing after icons */
.ev-icon i,
.safety-icon i {
    margin-right: 1.25rem !important;
    display: inline-block;
}

.ev-feature-item .d-flex,
.safety-feature .d-flex {
    align-items: flex-start;
}

/* ================================= */
/* DASHBOARD: PROFESSIONAL & CENTERED */
/* ================================= */

/* Device Cards - Premium */
.device-card {
    transition: all .3s ease;
    border: none !important;
    max-width: 380px;
    margin: 0 auto;
}

    .device-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(0,0,0,.15) !important;
    }

    .device-card .card-header {
        background: linear-gradient(135deg, #28a745, #20c997);
        color: #fff;
        border-bottom: none;
        font-weight: 600;
    }

    .device-card.offline .card-header {
        background: linear-gradient(135deg, #dc3545, #fd7e14) !important;
    }

    .device-card .badge {
        font-size: .75rem;
        padding: .35em .65em;
    }

    .device-card .card-footer {
        background: #f8f9fa;
        border-top: 1px solid #eee;
    }

.space-y-3 > li {
    margin-bottom: .75rem;
}

    .space-y-3 > li:last-child {
        margin-bottom: 0;
    }

/* SMALL MAP: */
.dashboard-map-small {
    max-width: 600px;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto 1rem;
}

/* Mobile */
@media (max-width: 576px) {
    .dashboard-map-small {
        max-width: 400px;
    }
}

/* Optional: Remove old .dashboard-map if not used */
.dashboard-map {
    display: none;
}


#toastContainer .toast {
    min-width: 260px;
    max-width: 360px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    border-radius: 8px;
    overflow: hidden;
    border: 0;
}

    #toastContainer .toast .toast-header {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }

        #toastContainer .toast .toast-header svg {
            width: 16px;
            height: 16px;
            opacity: 0.95;
        }

    #toastContainer .toast .toast-body {
        padding: 0.75rem 0.75rem;
        font-size: 0.95rem;
    }

/* small tweak for warning header contrast */
#toastContainer .toast-header.bg-warning {
    background: #ffc107;
    color: #212529;
}

#toastContainer-top-right .toast,
#toastContainer-top-center .toast,
#toastContainer-bottom-center .toast {
    min-width: 220px;
    max-width: 360px;
    border-radius: 6px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
    overflow: hidden;
}

    #toastContainer-top-right .toast .toast-header,
    #toastContainer-top-center .toast .toast-header {
        padding: 0.35rem 0.6rem;
    }

    #toastContainer-top-right .toast .toast-body,
    #toastContainer-top-center .toast .toast-body {
        padding: 0.45rem 0.6rem;
        white-space: pre-wrap;
    }

@media (max-width: 576px) {
    .container.px-4,
    .container.px-sm-5 {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }

    h3.text-primary {
        font-size: 1.75rem;
    }
}

/* Footer list fixes */
.footer ul.list-unstyled li {
    white-space: nowrap; /* Prevents wrapping */
    overflow: hidden;
    text-overflow: ellipsis; /* Truncates long text nicely */
}

.footer ul.list-unstyled a {
    color: inherit;
    text-decoration: none;
}

    .footer ul.list-unstyled a:hover {
        color: #F79E01; /* Your brand orange hover */
    }

