/* Global Styles */
body {
    background-color: #2c3e50;
    color: #ffffff;
    font-family: Arial, sans-serif;
}

.container-fluid {
    max-width: 1200px;
    margin: 0 auto;
}

/* Readings Container */
.readings-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    justify-content: center;
}

.reading-card {
    background: rgba(52, 73, 94, 0.7);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    flex: 1;
    min-width: 250px;
    max-width: 350px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.reading-card.alert {
    background: rgba(220, 53, 69, 0.7);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Circular Gauge */
.gauge-container {
    width: 150px;
    height: 150px;
    margin: 1rem auto;
    position: relative;
    border-radius: 50%;
    background: #34495e;
    padding: 10px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.alert-indicator {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #dc3545;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    font-size: 0.8rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.alert-indicator i {
    animation: blink 1s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.gauge {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #2ecc71;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gauge::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 100%
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

.gauge.warning {
    background: #f1c40f;
}

.gauge.danger {
    background: #e74c3c;
    animation: flash 1s infinite;
}

@keyframes flash {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}

.gauge-unit {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 0.2rem;
}

@keyframes shine {
    0% {
        transform: translateX(-200%) translateY(-200%) rotate(45deg);
    }
    100% {
        transform: translateX(200%) translateY(200%) rotate(45deg);
    }
}

/* Navigation */
.nav-pills {
    background: rgba(52, 73, 94, 0.7);
    border-radius: 10px;
    padding: 0.5rem;
    margin: 1rem;
}

.nav-pills .nav-link {
    color: #ffffff;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
}

.nav-pills .nav-link.active {
    background-color: #3498db;
}

/* Contact Cards */
.contact-card {
    background: rgba(52, 73, 94, 0.7);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(5px);
}

.contact-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.contact-type.OWNER { background-color: #3498db; }
.contact-type.BFP { background-color: #e74c3c; }
.contact-type.OTHER { background-color: #2ecc71; }

/* Forms */
.form-control, .form-select {
    color: #000 !important;
    background-color: #fff;
}

.form-control:focus, .form-select:focus {
    color: #000 !important;
}

.form-control option, .form-select option {
    color: #000 !important;
    background-color: #fff;
}

/* Make sure placeholder text is visible */
.form-control::placeholder {
    color: #6c757d !important;
    opacity: 1;
}

/* Ensure dropdown text is readable */
.form-select option:checked {
    background-color: #0d6efd;
    color: #fff !important;
}

.form-control, .form-select {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-control:focus, .form-select:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: #3498db;
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
}

/* Modals */
.modal-content {
    background-color: #34495e;
    border: none;
}

.modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.modal-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Toast Styles */
.toast-container {
    z-index: 9999;
}

.toast {
    min-width: 200px;
    backdrop-filter: blur(10px);
}

.toast.bg-success {
    background-color: rgba(46, 204, 113, 0.9) !important;
}

.toast.bg-danger {
    background-color: rgba(231, 76, 60, 0.9) !important;
}

.toast.bg-warning {
    background-color: rgba(241, 196, 15, 0.9) !important;
}

.toast.bg-info {
    background-color: rgba(52, 152, 219, 0.9) !important;
}

.toast .btn-close-white {
    filter: brightness(0) invert(1);
}

/* Buttons */
.btn-primary {
    background-color: #3498db;
    border-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

/* Responsive Adjustments */
@media (max-width: 576px) {
    .readings-container {
        flex-direction: column;
    }
    
    .reading-card {
        width: 100%;
        max-width: none;
    }
    
    .gauge-container {
        width: 120px;
        height: 120px;
    }
}
