﻿html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%; /* Ensure full height */
    box-sizing: border-box;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* General styles */
body {
    background-color: #F5F5F5; /* Light gray background */
    color: #000b25; /* Dark blue text instead of gray */
    font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif; /* Source Sans Pro for body text */
}

/* Layout styles - Sticky footer implementation */
.page {
    width: 100%;
    min-height: 100vh; /* Full viewport height */
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

.page-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.content {
    flex: 1; /* Take remaining space to push footer down */
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Ensure the main content area can grow */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

main article {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header section styling - full width with no top spacing */
.ns-header-section {
    background-color: #000b25;
    width: 100vw;
    margin: 0;
    padding-top: 48px;
    padding-bottom: 32px;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-top: 0; /* Ensure no top margin */
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
    width: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

.ns-logo {
    height: 48px;
    margin-right: 16px;
    flex-shrink: 0; /* Prevent logo from shrinking */
}

.ns-header-title {
    color: #1ebcb2; /* Turquoise for headers */
    font-family: 'Source Serif Pro', Helvetica, Arial, sans-serif; /* Source Serif for headers */
    font-size: 3rem; /* Increased from 2.5rem for better prominence */
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 12px;
    margin-top: 0;
    text-align: center;
    flex: 1; /* Take remaining space */
    margin-right: 64px; /* Compensate for logo width to center title properly */
}

/* Intro section */
.ns-intro-section {
    margin-bottom: 2rem;
}

.ns-description {
    color: #000b25; /* Blue instead of gray */
    font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif; /* Source Sans Pro for body text */
    font-size: 1.15rem;
    font-weight: 400;
    margin-bottom: 0;
    opacity: 1; /* Remove opacity for better readability */
    padding: 20px;
}

/* Loading section */
.ns-loading-section {
    padding: 3rem 1rem;
}

.ns-spinner {
    color: #1ebcb2; /* NieuweStroom teal */
    width: 3rem;
    height: 3rem;
}

/* Status section */
.ns-status-section {
    margin-bottom: 2rem;
}

/* Meter information section */
.ns-meter-info-section .card-body {
    padding: 2rem;
}

.info-section {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.info-section-title {
    color: #1ebcb2; /* Turquoise for headers */
    font-family: 'Source Serif Pro', Helvetica, Arial, sans-serif; /* Source Serif for headers */
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #1ebcb2; /* Turquoise border instead of orange */
    text-align: center;
}

.meter-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-grow: 1;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

    .detail-row:last-child {
        border-bottom: none;
    }

.detail-label {
    font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif; /* Source Sans Pro for subheaders */
    font-weight: 700; /* Bold for subheaders */
    color: #000b25; /* Blue instead of gray */
    min-width: 100px;
    flex-shrink: 0;
}

.detail-value {
    font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif; /* Source Sans Pro for body text */
    font-weight: 400; /* Regular for body text */
    color: #000b25; /* Blue instead of gray */
    text-align: right;
    word-break: break-word;
    max-width: 200px;
}

.location-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    padding: 1.5rem;
}

.address-line {
    font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif; /* Source Sans Pro for body text */
    font-weight: 400; /* Regular for body text */
    color: #000b25; /* Blue instead of gray */
    padding: 0.25rem 0;
    text-align: center;
    line-height: 1.4;
}

    .address-line.fw-semibold {
        font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif; /* Source Sans Pro for subheaders */
        font-weight: 700; /* Bold for subheaders */
        font-size: 1.1rem;
        color: #000b25;
    }

/* Readings section - remove gradients */
.readings-card {
    background: #f8fdff; /* Solid color instead of gradient */
    border: 2px solid #b8e6ff;
}

.readings-card-header {
    background: #1ebcb2; /* Solid turquoise instead of gradient */
    color: #fff;
    border-bottom: 1px solid #148b85;
    font-family: 'Source Serif Pro', Helvetica, Arial, sans-serif; /* Source Serif for headers */
    font-weight: 700;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    padding: 1rem 1.5rem;
    font-size: 1.4rem; /* Increased from 1.1rem */
}

.readings-card-body {
    padding: 2.5rem 2rem;
    background: #f8fdff; /* Solid color instead of gradient */
}

.measurement-input-container {
    background: #fff; /* Solid white instead of gradient */
    border: 2px solid #b8e6ff;
    border-radius: 12px;
    padding: 1.5rem;
    height: 100%;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .measurement-input-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: #1ebcb2; /* Solid turquoise instead of gradient */
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .measurement-input-container:hover {
        border-color: #1ebcb2; /* NieuweStroom teal */
        box-shadow: 0 4px 12px rgba(30, 188, 178, 0.15);
        transform: translateY(-2px);
        background: #f8fdff; /* Solid color instead of gradient */
    }

        .measurement-input-container:hover::before {
            opacity: 1;
        }

.measurement-label {
    margin-bottom: 1rem;
    min-height: 4rem; /* Ensure consistent height for label area to accommodate two lines */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

    .measurement-label .form-label {
        font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif; /* Source Sans Pro for subheaders */
        font-size: 1.1rem;
        font-weight: 700; /* Bold for subheaders */
        color: #000b25; /* Blue instead of gray */
        margin-bottom: 0.5rem;
        line-height: 1.3; /* Improve line spacing for wrapped text */
        min-height: 2.6rem; /* Reserve space for two lines of text */
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

.expected-range {
    background-color: #e7f3ff;
    padding: 0.5rem;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.measurement-input-wrapper {
    display: flex;
    justify-content: center;
}

    .measurement-input-wrapper .input-group {
        max-width: 200px;
    }

/* Links */
a, .btn-link {
    color: #1ebcb2; /* NieuweStroom teal for links */
    text-decoration: none;
}

    a:hover, .btn-link:hover {
        color: #FF6600; /* Orange hover effect */
    }

/* Buttons */
.btn-primary {
    color: #FFFFFF; /* White text */
    background-color: #1ebcb2; /* NieuweStroom teal */
    border-color: #19a299; /* Darker teal */
}

    .btn-primary:hover {
        background-color: #19a299; /* Darker teal on hover */
        border-color: #148b85;
    }

.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 #1ebcb2; /* NieuweStroom teal focus effect */
}

/* Validation styles */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #1ebcb2; /* NieuweStroom teal for valid fields */
}

.invalid {
    outline: 1px solid #FF6600; /* Orange for invalid fields */
}

.validation-message {
    color: #FF6600; /* Orange for validation messages */
}

/* Cards */
.custom-card {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    background-color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

    .custom-card:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    }

.custom-card-header {
    background: #1ebcb2; /* Solid turquoise instead of gradient */
    border-bottom: 1px solid #E0E0E0;
    font-family: 'Source Serif Pro', Helvetica, Arial, sans-serif; /* Source Serif for headers */
    font-weight: 700;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    color: #FFFFFF; /* White text on turquoise background */
    padding: 1rem 1.5rem;
    font-size: 1.4rem; /* Increased from 1.1rem */
}

/* Inputs */
.custom-input {
    border: 2px solid #CCCCCC;
    border-radius: 8px;
    padding: 12px 16px;
    background-color: #FFFFFF;
    color: #000b25; /* Blue text instead of gray */
    font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif; /* Source Sans Pro for input text */
    font-size: 1.2rem;
    font-weight: 400; /* Regular weight */
    transition: all 0.3s ease;
}

    .custom-input:focus {
        border-color: #1ebcb2; /* NieuweStroom teal */
        box-shadow: 0 0 0 0.2rem rgba(30, 188, 178, 0.25);
        background-color: #fafffe;
    }

    .custom-input:disabled {
        background-color: #f8f9fa;
        opacity: 0.7;
    }

.ns-unit-label {
    background-color: #1ebcb2; /* NieuweStroom teal */
    border: 2px solid #1ebcb2;
    border-left: none;
    color: #fff;
    font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif; /* Source Sans Pro for labels */
    font-weight: 700; /* Bold for labels */
    font-size: 1rem;
}

/* Submit button section spacing */
.ns-submit-section {
    margin-bottom: 2rem !important; /* Ensure spacing between submit button and footer */
}

/* Submit button styles - remove gradients */
.ns-submit-btn {
    background: #fed375; /* Solid yellow instead of gradient */
    color: #181e34;
    border: none;
    border-radius: 50px;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif; /* Source Sans Pro for button text */
    font-weight: 700; /* Bold for button text */
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 250px;
    box-shadow: 0 4px 12px rgba(254, 211, 117, 0.3);
}

    .ns-submit-btn:hover,
    .ns-submit-btn:focus {
        background: #181e34; /* Solid dark blue instead of gradient */
        color: #fff;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(24, 30, 52, 0.3);
    }

    .ns-submit-btn:disabled {
        background: #CCCCCC;
        color: #888;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

/* Success/Error messages */
.alert-success {
    background-color: #e8faf9; /* Light teal background */
    color: #0d5450; /* Dark teal text */
    border: 1px solid #b3e5e1; /* Medium teal border */
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #1ebcb2; /* NieuweStroom teal */
}

.alert-danger {
    background-color: #F2DEDE;
    color: #A94442;
    border: 1px solid #EBCCD1;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #d9534f;
}

.alert-warning {
    background-color: #FCF8E3;
    color: #8A6D3B;
    border: 1px solid #FAEBCC;
    border-radius: 6px;
    padding: 10px 15px;
    border-left: 3px solid #f0ad4e;
}

.alert-info {
    background-color: #D9EDF7;
    color: #31708F;
    border: 1px solid #BCE8F1;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #5bc0de;
}

/* Content wrapper */
.ns-content-wrapper {
    max-width: 60vw;
    margin-left: 20vw;
    margin-right: 20vw;
    width: 100%;
    padding-top: 2rem; /* Add some top padding to separate from header */
    flex: 1; /* Allow content to grow and push footer down */
    display: flex;
    flex-direction: column;
}

/* Ensure content sections can grow */
.ns-intro-section,
.ns-status-section,
.ns-meter-info-section,
.ns-readings-section,
.ns-submit-section,
.ns-home-section {
    flex-shrink: 0; /* Don't shrink these sections */
}

/* Footer - sticky footer implementation */
.ns-footer {
    background: #1ebcb2; /* Solid turquoise instead of gradient */
    color: #fff;
    font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif; /* Source Sans Pro for footer text */
    font-size: 1rem;
    font-weight: 400; /* Regular weight */
    width: 100vw;
    margin: 0;
    padding: 3rem 0 2rem 0;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-top: auto; /* Push footer to bottom with flexbox */
    flex-shrink: 0; /* Prevent footer from shrinking */
}

    .ns-footer .container {
        max-width: 1200px;
        margin: 0 auto;
        padding-left: 24px;
        padding-right: 24px;
    }

.footer-content {
    max-width: 100%;
}

.footer-title {
    color: #fff;
    font-family: 'Source Serif Pro', Helvetica, Arial, sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.footer-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2rem;
}

.footer-links {
    margin-bottom: 2rem;
}

.footer-link-item {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
    height: 100%;
}

.footer-link-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.footer-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
    color: #fed375;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.footer-link-item div {
    flex: 1;
}

.footer-link-item strong {
    display: block;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.ns-footer-link {
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

    .ns-footer-link:hover {
        color: #fed375;
        border-bottom-color: #fed375;
    }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1.5rem;
    margin-top: 1rem;
}

.footer-bottom .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.9rem;
}

/* Home page styles */
.ns-home-section {
    padding: 3rem 0;
}

.home-card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: none;
}

.home-content {
    padding: 2rem 1rem;
}

.home-icon {
    font-size: 4rem;
    color: #1ebcb2;
    opacity: 0.8;
}

.home-title {
    color: #000b25;
    font-family: 'Source Serif Pro', Helvetica, Arial, sans-serif;
    font-weight: 700;
    font-size: 2.5rem; /* Increased from 2rem */
}

.home-description {
    color: #000b25;
    font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
}

.home-actions {
    margin-top: 2rem;
}

.home-actions .btn {
    font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

.home-actions .btn-primary {
    background-color: #1ebcb2;
    border-color: #1ebcb2;
    color: #fff;
}

.home-actions .btn-primary:hover {
    background-color: #19a299;
    border-color: #148b85;
    color: #fff;
    transform: translateY(-1px);
}

.home-actions .btn-outline-primary {
    color: #1ebcb2;
    border-color: #1ebcb2;
    background-color: transparent;
}

.home-actions .btn-outline-primary:hover {
    background-color: #1ebcb2;
    border-color: #1ebcb2;
    color: #fff;
    transform: translateY(-1px);
}

/* Responsive footer and home page adjustments */
@media (max-width: 768px) {
    .ns-footer {
        padding: 2rem 0 1.5rem 0;
    }
    
    .footer-title {
        font-size: 1.3rem;
    }
    
    .footer-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .footer-link-item {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem 1rem;
    }
    
    .footer-icon {
        margin-right: 0;
        margin-bottom: 1rem;
        margin-top: 0;
    }
    
    .footer-links .col-md-6 {
        margin-bottom: 1rem;
    }
    
    .ns-footer .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .ns-home-section {
        padding: 2rem 0;
    }
    
    .home-content {
        padding: 1.5rem 0.5rem;
    }
    
    .home-icon {
        font-size: 3rem;
    }
    
    .home-title {
        font-size: 1.5rem;
    }
    
    .home-description {
        font-size: 1rem;
    }
    
    .home-actions .btn {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
        margin-right: 0 !important;
    }
    
    .home-actions .btn:last-child {
        margin-bottom: 0;
    }
}

/* Enhanced responsive design */
@media (max-width: 1400px) {
    .ns-content-wrapper {
        max-width: 75vw;
        margin-left: 12.5vw;
        margin-right: 12.5vw;
    }

    .header-inner {
        max-width: 90%;
    }
}

@media (max-width: 1200px) {
    .ns-content-wrapper {
        max-width: 90vw;
        margin-left: 5vw;
        margin-right: 5vw;
    }

    .measurement-input-container {
        padding: 1.25rem;
    }

    .ns-meter-info-section .card-body,
    .readings-card-body {
        padding: 1.5rem;
    }

    .header-inner {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@media (max-width: 992px) {
    .detail-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .detail-label {
        min-width: auto;
        font-size: 0.9rem;
    }

    .detail-value {
        text-align: left;
        max-width: none;
    }

    .location-details {
        margin-top: 1rem;
        padding: 1rem;
    }

    .info-section-title {
        text-align: left;
    }

    .header-inner {
        flex-direction: column;
        text-align: center;
    }

    .ns-logo {
        margin: 0 0 1rem 0;
    }

    .ns-header-title {
        font-size: 2.5rem; /* Slightly smaller on tablet/mobile */
        margin-right: 0; /* Remove right margin on mobile */
    }
    
    /* Adjust card header sizes for smaller screens */
    .custom-card-header,
    .readings-card-header {
        font-size: 1.2rem;
    }
    
    /* Ensure submit section spacing on mobile */
    .ns-submit-section {
        margin-bottom: 3rem !important;
        padding-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .footer-link-item {
        padding: 1rem 0.75rem;
    }
    
    .footer-description {
        font-size: 0.95rem;
    }
    
    .ns-footer .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .measurement-input-wrapper .input-group {
        max-width: 180px;
    }

    .custom-input {
        font-size: 1rem;
    }

    .ns-submit-btn {
        min-width: 180px;
        font-size: 0.95rem;
    }

    .header-inner,
    .ns-footer .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .ns-content-wrapper {
        padding-top: 1rem; /* Minimal top padding on small screens */
    }
    
    /* Adjust title and header sizes for small screens */
    .ns-header-title {
        font-size: 2rem; /* Smaller on mobile */
    }
    
    .home-title {
        font-size: 1.8rem; /* Adjusted for mobile */
    }
    
    .custom-card-header,
    .readings-card-header {
        font-size: 1.1rem; /* Smaller but still prominent on mobile */
    }
    
    /* Reduce submit section spacing on very small screens */
    .ns-submit-section {
        margin-bottom: 2.5rem !important;
        padding-bottom: 1rem;
    }
    
    /* Adjust label height for smaller screens */
    .measurement-label {
        min-height: 3.5rem; /* Slightly reduced for mobile */
    }
    
    .measurement-label .form-label {
        font-size: 1rem; /* Smaller font on mobile */
        min-height: 2.2rem; /* Adjust for smaller font */
    }
}
