﻿/* Global styles */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 60px;
    padding-top: 80px; /* Space for fixed navbar */
    background-color: #F8F9F5; /* Soft off-white background */
    color: #1A3C34; /* Deep forest green text */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Fixed Navbar */
.navbar.navbar-expand-sm.navbar-light {
    position: fixed; /* Keep navbar at top */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1030; /* Ensure it’s above other content */
    background-image: url('https://www.transparenttextures.com/patterns/camo.png') !important;
    background-size: cover;
    background-position: center;
    background-color: darkgreen;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

.navbar-brand, .nav-link {
    color: #F8F9F5 !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

    .navbar-brand:hover, .nav-link:hover {
        color: #C8D1C2 !important;
    }

/* Cards */
.card {
    background-color: #FDFDFB;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

    .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    }

.card-img-top {
    height: 300px;
    object-fit: cover;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.card-title {
    color: #1A3C34;
    font-weight: 600;
}

.card-text {
    color: #355E55;
}

/* Camera status */
.camera-status {
    color: #28A745; /* Green for online */
    /*font-weight: bold;*/
}

    .camera-status.offline {
        color: #DC3545; /* Red for offline */
    }

/* Battery icon */
.battery {
    display: flex;
    align-items: center;
    gap: 2px;
    border: 2px solid #1A3C34;
    border-radius: 3px;
    padding: 2px;
    width: fit-content;
    height: 18px;
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: #FDFDFB;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Battery bars */
.battery-bar {
    width: 6px;
    height: 14px;
    background: #ccc;
    border-radius: 2px;
}

/* Battery cap */
.battery-cap {
    position: absolute;
    right: -6px;
    top: 5px;
    width: 4px;
    height: 8px;
    background: #1A3C34;
    border-radius: 1px;
}

/* Battery levels */
.battery[data-level="1"] .battery-bar:nth-of-type(1) {
    background: #DC3545;
}

.battery[data-level="2"] .battery-bar:nth-of-type(-n+2) {
    background: #FFC107;
}

.battery[data-level="3"] .battery-bar:nth-of-type(-n+3),
.battery[data-level="4"] .battery-bar:nth-of-type(-n+4),
.battery[data-level="5"] .battery-bar:nth-of-type(-n+5) {
    background: #28A745;
}

/* Empty battery styling */
.battery[data-level="0"] {
    border-color: #DC3545;
}

    .battery[data-level="0"] .battery-bar {
        background: transparent; /* hide bars for empty battery */
    }

    .battery[data-level="0"]::before {
        content: '';
        position: absolute;
        top: 1px;
        left: 1px;
        width: calc(100% - 2px);
        height: calc(100% - 2px);
        border-left: 2px solid red;
        border-bottom: 2px solid red;
        transform: rotate(45deg);
        transform-origin: center;
    }

/* Map container */
.map {
    height: 500px;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: #FDFDFB;
}

/* Trap marker */
.trap-marker {
    border: 2px solid #1A3C34; /* Forest green border */
}

/* Custom Buttons for Settings */
.btn-custom {
    padding: 0.4rem 1rem; /* Consistent padding */
    border-radius: 8px; /* Rounded corners */
    font-size: 0.875rem; /* Consistent font size */
    font-weight: 500; /* Consistent weight */
    color: #F8F9F5; /* White text */
    border: none; /* No border */
    transition: background-color 0.3s ease, transform 0.2s ease; /* Smooth transitions */
    display: inline-block; /* Consistent sizing */
    text-align: center;
    line-height: 1.5; /* Consistent vertical alignment */
    margin-right: 0.5rem; /* Space between buttons */
}

    .btn-custom:hover {
        transform: translateY(-2px); /* Subtle lift on hover */
    }

.btn-edit {
    background-color: #1A3C34; /* Deep forest green for edit */
}

    .btn-edit:hover {
        background-color: #2E4A2A; /* Lighter green on hover */
    }

.btn-delete {
    background-color: #DC3545; /* Red for delete */
}

    .btn-delete:hover {
        background-color: #C82333; /* Darker red on hover */
    }

.btn-register {
    padding: 0.6rem 1.5rem; /* Larger padding for bigger button */
    border-radius: 8px; /* Rounded corners */
    font-size: 1rem; /* Larger font size */
    font-weight: 500; /* Consistent weight */
    color: #F8F9F5; /* White text */
    background-color: #258cfb; /* Blue for register */
    border: none; /* No border */
    transition: background-color 0.3s ease, transform 0.2s ease; /* Smooth transitions */
    display: inline-block;
    text-align: center;
    line-height: 1.5;
}

    .btn-register:hover {
        background-color: #1a6fd9; /* Darker blue on hover */
        transform: translateY(-2px); /* Subtle lift on hover */
    }

/* Buttons */
.btn-primary {
    background-color: white;
    color:black;
    border-color: #1A3C34;
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

    .btn-primary:hover {
        background-color: #2E4A2A;
        border-color: #2E4A2A;
        transform: translateY(-2px);
    }

.btn-outline-secondary {
    border-color: #355E55;
    color: #355E55;
    border-radius: 8px;
    padding: 0.25rem 0.75rem;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

    .btn-outline-secondary:hover {
        background-color: #355E55;
        color: #F8F9F5;
        transform: translateY(-2px);
    }

.btn-icon-sm {
    padding: 0.2rem;
    border-radius: 50%;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

/* Footer */
.footer {
    background-color: darkgreen;
    color: #F8F9F5;
    padding: 1rem 0;
    line-height:20px !important;
}

/* Focus styles */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem #F8F9F5, 0 0 0 0.25rem #1A3C34;
}

.card {
    position: relative;
}

.detection-badge {
    position: absolute;
    bottom: 175px;
    left: 12px;
    background-color: darkred;
    color: #F8F9F5;
    font-size: 1rem;
    /*padding: 0.2rem 0.4rem;*/
    border-radius: 7px;
    border: 2px solid #F8F9F5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
}
