/* CSS Document */

/* Base Styles */
body {
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    background: linear-gradient(120deg, #e0e7ff 0%, #f8fafc 100%);
    margin: 0;
    min-height: 100vh;
    color: #222;
    letter-spacing: 0.01em;
    padding-top: 70px; /* Account for fixed header */
}

/* Modern Header Styles */
.navbar {
    background-color: #3D4337;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    padding: 15px 0;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
    color: #ffffff;
}

.navbar-brand i {
    font-size: 1.3rem;
}

.navbar .nav-link {
    color: #374151;
    font-weight: 500;
    margin: 0 8px;
    transition: color 0.2s;
    font-size: 0.95rem;
}

.navbar .nav-link:hover {
    color: #2563eb;
}

/* Navbar brand and nav-link styles */
.navbar-brand,
.navbar .nav-link {
    color: #fff !important;
    font-weight: 600;
    transition: color 0.2s, background 0.2s;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus,
.navbar-brand:hover,
.navbar-brand:focus {
    color: #22c55e !important; /* Modern green */
    background: transparent;
    text-shadow: 0 2px 8px rgba(34,197,94,0.10);
}

/* Optional: Make the brand stand out a bit more on hover */
.navbar-brand {
    font-size: 1.7rem;
    letter-spacing: 1px;
}

.login-btn {
    color: white !important;
    padding: 0.5rem 1.25rem !important;
    border-radius: 8px;
    margin-left: 10px;
    background: linear-gradient(90deg, #6366f1 0%, #2563eb 100%);
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.35);
    background: linear-gradient(90deg, #4f46e5 0%, #1d4ed8 100%);
}

.navbar-toggler {
    border: none;
    color: #374151;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section - Modern Version */
.hero-section {
    min-height: 30vh;
    background: url("./assets/Agrupamento-de-escolas-de-pombal_home_menu_.jpg")
        center/cover no-repeat;
    position: relative;
    margin-top: -70px; /* Compensate for fixed header */
    padding-top: 70px;
}

.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.5));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
}

.hero-section h1 {
    font-size: 3.2rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.hero-section .lead {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Feature Item Styles */
.features {
    margin-top: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 10px 0;
    border-radius: 8px;
    transition: transform 0.2s;
}

.feature-item:hover {
    transform: translateX(5px);
}

.feature-item i {
    color: #22c55e; /* Modern green */
    font-size: 1.5rem;
    margin-right: 15px;
    min-width: 40px;
    text-align: center;
}

/* Sensor Data Section */
#refresh-btn {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.7em 1.5em;
    font-size: 1.08em;
    cursor: pointer;
    margin-bottom: 1.5em;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
    transition: background 0.2s, transform 0.2s;
}

#refresh-btn:hover {
    background: linear-gradient(90deg, #16a34a 0%, #22c55e 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(34, 197, 94, 0.35);
}

#refresh-btn i {
    transition: transform 0.4s;
}

#refresh-btn:hover i {
    transform: rotate(180deg);
}

/* Footer with Social Icons */
footer {
    background: #1e293b;
    padding: 3rem 0 2rem;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 1.5rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: #2563eb;
    transform: translateY(-3px);
    color: white;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1em;
    background: #f9fafb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

th,
td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    font-size: 1em;
}

th {
    background: #f1f5f9;
    color: #374151;
    font-weight: 600;
    letter-spacing: 0.01em;
}

tr:last-child td {
    border-bottom: none;
}

.details-btn {
    background: #d1fae5;
    color: #166534;
    border: none;
    border-radius: 6px;
    padding: 0.5em 1.2em;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(34, 197, 94, 0.15);
}

.details-btn:hover {
    background: #22c55e;
    color: #fff;
    transform: translateY(-2px);
}

.details-row > td {
    background: #f1f5fa;
    border-bottom: none;
    padding: 0;
}

.details-row > td > div {
    padding: 1.2em 2em;
    font-size: 0.98em;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 12px 12px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sensor History Table */
#sensor-history table {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(99, 102, 241, 0.08);
    overflow: hidden;
}

#sensor-history th,
#sensor-history td {
    text-align: center;
    vertical-align: middle;
}

#sensor-history th {
    background: #d1fae5;
    color: #166534;
    font-size: 1.08em;
}

#sensor-history tr:nth-child(even) {
    background: #f3f4f6;
}

#sensor-history tr:hover {
    background: #bbf7d0;
    transition: background 0.2s;
}

#history-date {
    min-width: 140px;
}

@media (max-width: 600px) {
    #sensor-history table,
    #sensor-history th,
    #sensor-history td {
        font-size: 0.92em;
        padding: 0.5em 0.3em;
    }
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }

    .navbar-collapse {
        background: white;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        margin-top: 15px;
    }
}

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section .lead {
        font-size: 1.1rem;
    }

    th,
    td {
        padding: 0.8em 0.8em;
        font-size: 0.95em;
    }
}

/* Make all footer images the same size */
.patrocinio-main-img {
    width: 200px;
    height: 100px;
    max-width: 250px;
    max-height: 120px;
    object-fit: contain;
}

.selo-semfundo-img {
    width: 110px !important;
    height: 40px !important;
    object-fit: contain;
}

/* Section fade-in animation */
.section-animate {
    opacity: 0;
    transform: translateY(60px) scale(0.97);
    filter: blur(8px);
    transition:
        opacity 0.7s cubic-bezier(.4,0,.2,1),
        transform 0.7s cubic-bezier(.4,0,.2,1),
        filter 0.7s cubic-bezier(.4,0,.2,1);
}
.section-animate.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

/* Modern hover for buttons */
.btn, .details-btn, #refresh-btn {
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.18s cubic-bezier(.4,2,.2,1);
}

.btn:active, .details-btn:active, #refresh-btn:active {
    transform: scale(0.96);
}

/* Linhas da tabela com destaque moderno */
table tbody tr {
    transition: background 0.18s, box-shadow 0.18s;
}
table tbody tr:hover {
    background: #e0f2fe;
    box-shadow: 0 2px 12px rgba(34,197,94,0.08);
}