/* Verdanist Custom Styles */
/* Shared across all pages */

/* Pulse Dot Animation */
.pulse-dot {
    box-shadow: 0 0 4px 2px rgba(75, 226, 119, 0.4);
}

/* Material Symbols Icon Fill */
.icon-fill {
    font-variation-settings: 'FILL' 1;
}

/* Glass Panel Effect (used in login) */
.glass-panel {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.dark .glass-panel {
    background-color: rgba(34, 31, 29, 0.85);
}

/* Base Typography Defaults */
body {
    font-family: 'Manrope', sans-serif;
}

h1, h2, h3, h4, h5, h6, .font-headline {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Material Symbols Settings */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Selection Styling */
::selection {
    background-color: #22c55e;
    color: #004b1e;
}

/* Scrollbar Styling for WebKit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4be277;
}

.dark ::-webkit-scrollbar-track {
    background: #1e1b19;
}

.dark ::-webkit-scrollbar-thumb {
    background: #3d4a3d;
}

/* Safe Area Padding for Mobile */
.pb-safe {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Animation for loading states */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse-slow {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Dropdown Menu Styles */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 1rem;
    padding: 0.5rem;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.dark .dropdown-menu {
    background: rgba(34, 31, 29, 0.95);
    border: 1px solid rgba(134, 149, 133, 0.2);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(75, 226, 119, 0.1);
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(8px) scale(1);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #111827;
    font-family: 'Manrope', sans-serif;
    font-size: 0.875rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.dark .dropdown-item {
    color: #e9e1dd;
}

.dropdown-item:hover {
    background: rgba(75, 226, 119, 0.1);
    color: #4be277;
}

.dropdown-item .material-symbols-outlined {
    font-size: 1.25rem;
    color: #869585;
    transition: color 0.15s ease;
}

.dropdown-item:hover .material-symbols-outlined {
    color: #4be277;
}

.dropdown-divider {
    height: 1px;
    background: rgba(134, 149, 133, 0.2);
    margin: 0.5rem 0;
}

.dropdown-header {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #869585;
    font-weight: 600;
}

/* Card Menu Button Container */
.card-menu-container {
    position: relative;
}

/* Device Heartbeat Animation */
@keyframes heartbeat {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.95);
    }
}

.device-heartbeat {
    animation: heartbeat 2s ease-in-out infinite;
}

.device-heartbeat.offline {
    animation: none;
    color: #ff6b6b !important;
}

.device-heartbeat.weak {
    color: #ffd93d !important;
}

/* Chart Tooltip Styles */
.chart-tooltip {
    position: absolute;
    background: rgba(34, 31, 29, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(134, 149, 133, 0.3);
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    font-family: 'Manrope', sans-serif;
    font-size: 0.75rem;
    color: #e9e1dd;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 50;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.chart-tooltip.visible {
    opacity: 1;
}

.chart-tooltip .tooltip-time {
    color: #869585;
    font-size: 0.65rem;
    margin-bottom: 0.25rem;
}

.chart-tooltip .tooltip-value {
    font-weight: 600;
    color: #4be277;
}

/* Time Range Filter Buttons */
.time-filter-btn {
    padding: 0.25rem 0.75rem;
    font-family: 'Manrope', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: #869585;
    background: transparent;
    border: 1px solid rgba(134, 149, 133, 0.2);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-filter-btn:hover {
    color: #e9e1dd;
    border-color: rgba(134, 149, 133, 0.4);
}

.time-filter-btn.active {
    color: #161311;
    background: #4be277;
    border-color: #4be277;
}

/* Dynamic Gauge Colors */
.gauge-optimal {
    color: #4be277 !important;
}

.gauge-warning {
    color: #ffd93d !important;
}

.gauge-critical {
    color: #ff6b6b !important;
}

/* Water Usage Display */
.water-usage {
    font-family: 'Manrope', sans-serif;
    font-size: 0.75rem;
    color: #869585;
    text-align: center;
    margin-top: 0.5rem;
}

.water-usage .usage-value {
    color: #4be277;
    font-weight: 600;
}

/* Chart Axis Labels */
.chart-y-axis {
    position: absolute;
    left: 8px;
    top: 10px;
    bottom: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: 'Manrope', sans-serif;
    font-size: 0.65rem;
    color: #e9e1dd;
    z-index: 20;
}

.chart-y-axis span {
    line-height: 1;
}

.chart-y-axis.right {
    left: auto;
    right: 8px;
}

.chart-x-axis {
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-family: 'Manrope', sans-serif;
    font-size: 0.65rem;
    color: #e9e1dd;
    z-index: 20;
}

.chart-x-axis span {
    line-height: 1;
}

/* Chart Gridlines */
.chart-gridline {
    stroke: rgba(134, 149, 133, 0.15);
    stroke-width: 1;
    stroke-dasharray: 4, 4;
}

/* Data Point Markers */
.chart-data-point {
    fill: #161311;
    stroke-width: 2;
    r: 4;
    transition: r 0.2s ease;
}

.chart-data-point:hover {
    r: 6;
    cursor: pointer;
}

.chart-data-point.temp {
    stroke: #4be277;
}

.chart-data-point.moisture {
    stroke: #8bcfff;
}

/* Chart Container with padding for labels */
.chart-with-labels {
    position: relative;
    padding-left: 40px;
    padding-right: 45px;
    padding-top: 10px;
    padding-bottom: 25px;
}

@media (min-width: 640px) {
    .chart-with-labels {
        padding-left: 50px;
        padding-right: 55px;
        padding-top: 10px;
        padding-bottom: 30px;
    }
}

/* Mobile-responsive chart axis labels */
@media (max-width: 639px) {
    .chart-with-labels {
        padding-left: 35px;
        padding-right: 40px;
        padding-top: 8px;
        padding-bottom: 22px;
    }
    
    .chart-y-axis {
        left: 6px;
        top: 8px;
        bottom: 22px;
        font-size: 0.6rem;
    }
    
    .chart-y-axis.right {
        right: 6px;
    }
    
    .chart-x-axis {
        bottom: 3px;
        font-size: 0.55rem;
    }
    
    .chart-data-point {
        r: 3;
    }
    
    .chart-data-point:hover {
        r: 4;
    }
}

/* Ensure chart doesn't overflow on small screens */
#chart-container {
    min-width: 0;
    overflow: hidden;
}

/* Mobile tooltip adjustments */
@media (max-width: 639px) {
    .chart-tooltip {
        font-size: 0.65rem;
        padding: 0.375rem 0.75rem;
    }
    
    .chart-tooltip .tooltip-time {
        font-size: 0.6rem;
    }
}

/* Activity Log Filter Buttons */
.log-filter-btn {
    background: rgba(134, 149, 133, 0.1);
    border: 1px solid rgba(134, 149, 133, 0.2);
    color: #869585;
}

.log-filter-btn:hover {
    background: rgba(134, 149, 133, 0.2);
    border-color: rgba(134, 149, 133, 0.3);
    color: #e9e1dd;
}

.log-filter-btn.active {
    background: #4be277;
    border-color: #4be277;
    color: #161311;
}

/* Activity Log Items */
.log-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.75rem 0.5rem;
    border-radius: 0.75rem;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.log-item:hover {
    background: rgba(134, 149, 133, 0.1);
}

.log-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.log-icon.pump-on {
    background: rgba(75, 226, 119, 0.2);
    color: #4be277;
}

.log-icon.pump-off {
    background: rgba(134, 149, 133, 0.15);
    color: #869585;
    border: 1px solid rgba(134, 149, 133, 0.2);
}

.log-icon.alert {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

.log-icon.settings {
    background: rgba(139, 207, 255, 0.2);
    color: #8bcfff;
}

.log-content {
    flex: 1;
    min-width: 0;
}

.log-title {
    font-family: 'Manrope', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: #e9e1dd;
    line-height: 1.4;
}

.log-subtitle {
    font-family: 'Manrope', sans-serif;
    font-size: 0.75rem;
    color: #869585;
    margin-top: 0.125rem;
}

.log-time {
    font-family: 'Manrope', sans-serif;
    font-size: 0.65rem;
    color: #869585;
    margin-top: 0.375rem;
}

.log-duration {
    display: inline-block;
    background: rgba(75, 226, 119, 0.15);
    color: #4be277;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.log-zone-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    margin-left: 0.5rem;
}

.log-zone-badge.zone-a {
    background: rgba(75, 226, 119, 0.15);
    color: #4be277;
}

.log-zone-badge.zone-b {
    background: rgba(139, 207, 255, 0.15);
    color: #8bcfff;
}
