/* 
   Main stylesheet for seairCare portal
   This file contains global styles that are used across the portal
   Theme: Futuristic High-Tech Aquaculture
*/

/* Import modern fonts */
@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;500;600;700&family=Roboto:wght@300;400;500;700&display=swap');

/* Reset and base styles */
* {
    box-sizing: border-box;
}

/* Global underline-only input fields */
input[type="text"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="email"],
input[type="password"],
select,
textarea {
    border: none;
    border-bottom: 1px solid #ccc;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 6px 2px;
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-bottom-color: var(--primary, #0088cc);
}

/* Ensure any generic search inputs use underline-only styling */
.search-input {
    border: none;
    border-bottom: 1px solid #ccc;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 6px 2px;
}
.search-input:focus { outline: none; border-bottom-color: var(--primary, #0088cc); }

:root {
    /* Primary color palette - aquatic blues and teals */
    --primary-dark: #005a87;
    --primary: #0088cc;
    --primary-light: #00b8e6;
    --accent: #00e4ff;
    --accent-glow: rgba(0, 228, 255, 0.4);

    /* Secondary colors */
    --secondary: #1e3d59;
    --secondary-light: #3d5a80;

    /* Neutral colors */
    --dark: #0a192f;
    --light: #f8f9fa;
    --gray-dark: #343a40;
    --gray: #6c757d;
    --gray-light: #e9ecef;

    /* Status colors */
    --success: #00c896;
    --warning: #ffc107;
    --danger: #ff5a5f;
    --info: #17a2b8;

    /* UI elements */
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-shadow: 0 8px 32px rgba(0, 58, 87, 0.1);
    --header-gradient: linear-gradient(135deg, var(--primary-dark), var(--primary));
    --body-gradient: linear-gradient(135deg, #f0f8ff, #e6f7ff);
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--gray-dark);
    background: var(--body-gradient);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Exo 2', sans-serif;
    font-weight: 500;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-light);
    text-decoration: none;
}

/* Common components */
.btn {
    display: inline-inline; /* ensure consistent inline flow */
    padding: 8px 12px;
    background: #f5f5f5; /* neutral by default */
    color: #222;
    border: 1px solid #999;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
    overflow: visible; /* avoid clipping hover glow */
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Shared Compact Filters - filter-select moved from _filters.html for reuse */
/*.filter-select {
    padding: 6px 10px;
    min-width: 160px;
    height: 34px;
    border: none;
    border-bottom: 1px solid #bbb;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}*/

/* Base filter look */
.filter-select {
  height: 34px;
  line-height: 1;
  padding: 6px 10px;          /* baseline inset */
  min-width: 160px;
  border: none;                /* underline-only */
  border-bottom: 1px solid #bbb;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  vertical-align: bottom;      /* align underline for inline layout */
}


/* Dropdown visual styling for selects */
select.filter-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 28px;  /* leave space for arrow */
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E")
    no-repeat right 8px center / 12px;
}



/* Ensure date inputs align visually with custom select underlines */
.filter-select,
select.filter-select,
input[type="date"].filter-select {
  box-sizing: border-box;     /* make height include padding */
  display: inline-block;      /* keep them baseline aligned */
  vertical-align: middle;     /* align better with each other */
  height: 34px;               /* same height */
  line-height: 1.2;           /* consistent text baseline */
  padding: 6px 10px;          /* same inset */
  border: none;
  border-bottom: 1px solid #bbb;
  border-radius: 0;
  background: transparent;
}


select.filter-select:focus {
    outline: none;
    border-bottom-color: var(--primary, #2a74ff);
}

/* Multiple selects: We will render a custom dropdown UI; hide native visibility by default when enhanced */
select.filter-select[multiple].ms-hidden {
    display: none;
}

.filter-select:focus {
    outline: none;
    border-bottom-color: var(--primary, #2a74ff);
}

/* Custom Multi-Select Dropdown (Odoo-like filter bar) */
.ms { position: relative; display: inline-block; }
.ms-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 6px 28px 6px 10px;
    min-width: 160px;
    line-height: 1.2;
    background: transparent;
    border: none;
    border-bottom: 1px solid #bbb;
    border-radius: 0;
    cursor: pointer;
    color: #222;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
}
.ms-trigger:focus { outline: none; border-bottom-color: var(--primary, #2a74ff); }
.ms.open .ms-trigger { border-bottom-color: var(--primary, #2a74ff); }
.ms-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.ms-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 2000;
    min-width: 220px;
    max-width: 320px;
    max-height: 300px;
    overflow: auto;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    padding: 6px;
}
.ms.open .ms-menu { display: block; }
.ms-option { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.ms-option:hover { background: #f5faff; }
.ms-option input[type="checkbox"] { width: 16px; height: 16px; }
.ms-sep { height: 1px; background: #eee; margin: 6px 0; }
.ms-actions { display: flex; justify-content: space-between; gap: 8px; padding: 6px 2px 2px; }
.ms-actions .btn { height: 28px; padding: 0 10px; border-radius: 6px; }

/* Enforce a wider minimum width for the global search input when styled as filter-select */
input[name="search"].filter-select {
    min-width: 240px;
}

.btn:before {
    display: none; /* sheen disabled globally */
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.6s ease;
}

.btn:hover {
    background: #e9ecef;
    transform: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.10);
    text-decoration: none;
}

.btn:hover:before {
    left: 100%;
}

/* Primary button variant */
.btn-primary {
    background: #2a74ff;
    color: #fff;
    border: 1px solid #2a74ff;
}
.btn-primary:hover,
.btn-primary:focus {
    background: #1f5ed1;
    color: #fff;
    box-shadow: 0 6px 20px rgba(42, 116, 255, 0.45);
    outline: none;
}

/* Ensure anchor-based primary buttons keep white text on hover/focus */
a.btn.btn-primary:hover,
a.btn.btn-primary:focus { color: #fff; }

.btn-secondary {
    background: var(--secondary);
    box-shadow: 0 4px 15px rgba(30, 61, 89, 0.3);
}

.btn-secondary:hover {
    background: var(--secondary-light);
    box-shadow: 0 6px 20px rgba(61, 90, 128, 0.4);
}

.btn-success {
    background: var(--success);
    box-shadow: 0 4px 15px rgba(0, 200, 150, 0.3);
}

.btn-success:hover {
    background: var(--success);
    filter: brightness(110%);
    box-shadow: 0 6px 20px rgba(0, 200, 150, 0.4);
}

.btn-warning {
    background: var(--warning);
    color: var(--dark);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover {
    background: var(--warning);
    filter: brightness(110%);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

.btn-danger {
    background: var(--danger);
    box-shadow: 0 4px 15px rgba(255, 90, 95, 0.3);
}

.btn-danger:hover {
    background: var(--danger);
    filter: brightness(110%);
    box-shadow: 0 6px 20px rgba(255, 90, 95, 0.4);
}



label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--secondary);
    font-size: 0.95rem;
}

/* Card components */
.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(0, 136, 204, 0.1);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 58, 87, 0.15);
}

.card-header {
    border-bottom: 1px solid rgba(0, 136, 204, 0.1);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.card-header h2, .card-header h3 {
    margin: 0;
    color: var(--primary-dark);
    position: relative;
}

.card-header h2:after, .card-header h3:after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
}

/* Header and Navigation */
.topbar-header {
    background: var(--header-gradient);
    color: white;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: 0 4px 20px rgba(0, 58, 87, 0.2);
    position: relative;
    z-index: 100;
}

.topbar-header:before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.topbar-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    display: inline-block;
}

.topbar-header h1:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40%;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--accent);
}

.user-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.user-info span {
    margin-right: 15px;
    margin-bottom: 5px;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.logout-btn, .back-btn {
    background-color: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    margin-left: 10px;
    transition: all 0.3s ease;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.logout-btn:hover, .back-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: white;
    transform: translateY(-2px);
}

/* Table Styles */
.logs-table-container, .cubes-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    background-color: var(--card-bg);
}

.logs-table, .cubes-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.logs-table th, .logs-table td, .cubes-table th, .cubes-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 136, 204, 0.1);
}

.logs-table th, .cubes-table th {
    background-color: rgba(0, 136, 204, 0.05);
    font-weight: 500;
    color: var(--secondary);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.logs-table tr:hover, .cubes-table tr:hover {
    background-color: rgba(0, 184, 230, 0.05);
}

.logs-table tr:last-child td, .cubes-table tr:last-child td {
    border-bottom: none;
}

/* Status Indicators */
.status-normal {
    color: var(--success);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.status-normal:before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    margin-right: 6px;
    box-shadow: 0 0 8px var(--success);
}

.status-alert {
    color: var(--danger);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.status-alert:before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    margin-right: 6px;
    box-shadow: 0 0 8px var(--danger);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 90, 95, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(255, 90, 95, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 90, 95, 0);
    }
}

/* Cube Details Styling */
.cube-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1.2fr));
    gap: 20px;
    margin-bottom: 20px;
}

.cube-detail {
    background-color: rgba(248, 249, 250, 0.7);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 58, 87, 0.05);
    border: 1px solid rgba(0, 136, 204, 0.1);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.cube-detail:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 58, 87, 0.1);
}

.cube-detail-row {
    display: grid;
    grid-template-columns: 40% 60%;
    margin-bottom: 10px;
    align-items: center;
}

.cube-detail-label {
    font-weight: 500;
    padding-right: 10px;
    color: var(--secondary);
}

.cube-detail-value {
    text-align: left;
    color: var(--gray-dark);
}

/* Map Styling */
#map-container {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 136, 204, 0.1);
}

#map {
    width: 100%;
    height: 400px;
    border-radius: 8px;
}

/* Graph Styling */
.graph-container {
    margin-bottom: 25px;
}

.graph-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.graph-card {
    background-color: rgba(248, 249, 250, 0.7);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 58, 87, 0.05);
    height: 300px;
    border: 1px solid rgba(0, 136, 204, 0.1);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.graph-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 58, 87, 0.1);
}

/* Time Span Controls */
.time-span-controls {
    margin-bottom: 20px;
    text-align: center;
}

.btn-group {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.time-span-btn {
    background-color: rgba(248, 249, 250, 0.7);
    border: 1px solid rgba(0, 136, 204, 0.2);
    color: var(--secondary);
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.time-span-btn:hover {
    background-color: rgba(0, 184, 230, 0.1);
    border-color: rgba(0, 136, 204, 0.4);
}

.time-span-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 136, 204, 0.3);
}

/* Login Page Styling */
.login-container {
    background-color: var(--card-bg);
    padding: 35px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    width: 380px;
    max-width: 90%;
    border: 1px solid rgba(0, 136, 204, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.login-container:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.login-container h1 {
    text-align: center;
    color: var(--primary-dark);
    margin-bottom: 25px;
    font-size: 32px;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
    width: 100%;
}

.login-container h1:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .topbar-header {
        padding: 12px 15px;
    }

    .topbar-header h1 {
        font-size: 22px;
        margin-bottom: 10px;
    }

    .card {
        padding: 15px;
    }

    .cube-details, .graph-grid {
        grid-template-columns: 1fr;
    }

    .cube-detail-row {
        grid-template-columns: 1fr;
    }

    .cube-detail-label {
        margin-bottom: 4px;
    }

    .cube-detail-value {
        margin-bottom: 12px;
        padding-left: 10px;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .time-span-btn {
        width: 100%;
        margin-bottom: 5px;
    }
}


/* Shared Section Card (renamed from manual-runtime-entry) */
.section-card {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.section-card .section-header h2 {
    color: var(--primary);
    padding-bottom: 10px;
    margin-bottom: 12px;
    position: relative;
}
.section-card .section-header h2:after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
}
/* Accent heading for h3 inside section cards */
.section-card h3 {
    color: var(--primary);
    padding-bottom: 6px;
    margin-bottom: 8px;
    position: relative;
}
.section-card h3:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
}

/* Status pill styles (shared across pages) */
.status-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
}

/* Pending: blue */
.status-pending {
    background: #dbeafe;
    color: #1e3a8a;
}

/* Upcoming: yellow */
.status-upcoming {
    background: #fff3cd;
    color: #8a6d3b;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-overdue {
    background: #f8d7da;
    color: #721c24;
}

