/* Dashboard main layout and grid */
.dashboard-main-layout {
    display: flex;
    min-height: 100vh;
    background: #f7f7f7;
}
.dashboard-content {
    flex: 1;
    padding: 20px 15px;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    align-items: stretch;
}
.dashboard-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(211,47,47,0.09);
    padding: 12px;
    margin-bottom: 0;
    min-width: 0;
    height: 100%;
    min-height: 320px;
    display: flex;
    flex-direction: column;
}
.dashboard-card-title {
    font-size: 1.0em;
    font-weight: bold;
    color: #d32f2f;
    margin-bottom: 6px;
    flex-shrink: 0;
}
.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
    flex-grow: 1;
}
.dashboard-table th, .dashboard-table td {
    border: none;
    padding: 4px 6px;
    text-align: left;
    font-size: 0.85em;
}
.dashboard-table th {
    background: #d32f2f;
    color: #000;
    font-weight: bold;
}
.dashboard-table tr:nth-child(even) td {
    background: #f5f5f5;
}
.mini-radar {
    margin-top: 10px;
    text-align: center;
}
.mini-map {
    margin-top: 10px;
    width: 100%;
    height: 110px;
    border-radius: 6px;
    background: #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    flex-shrink: 0;
}
/* Sidebar styles (to be added in next step) */
.sidebar {
    width: 220px;
    min-width: 160px;
    background: linear-gradient(180deg, #d32f2f 0%, #b71c1c 100%);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding-top: 24px;
    min-height: 100vh;
    box-shadow: 2px 0 8px rgba(211,47,47,0.09);
}
.sidebar-icon {
    color: #fff;
    font-size: 2em;
    margin-bottom: 32px;
    cursor: pointer;
    transition: color 0.2s;
}
.sidebar-icon:hover {
    color: #ffcdd2;
}
/* Global resets and fonts */
body {
    font-family: Arial, sans-serif;
    background-color: #FFFFFF; /* White like videoicu.com for clean professionalism */
    color: #343A40;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    font-size: 0.9rem;
}

/* Layout: Sidebar and Content */
.layout-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    color: white;
    /* background already set above */
    padding: 0;
    z-index: 10;
@media (max-width: 900px) {
  .sidebar {
    width: 56px;
    min-width: 48px;
    padding-top: 12px;
    align-items: center;
    overflow-x: hidden;
    transition: width 0.2s;
  }
  .sidebar .sidebar-label,
  .sidebar .logo,
  .sidebar-nav a span {
    display: none !important;
  }
  .main-content {
    margin-left: 56px !important;
  }
}
}

.sidebar-logo {
    text-align: center;
    padding: 2rem 1rem 1rem 1rem;
    border-bottom: 1px solid #A52A2A55;
}

.sidebar .logo {
    width: 90px;
    margin: 0 auto;
    animation: fadeIn 1s ease;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li {
    margin: 0.5rem 0;
    padding-left: 1.2rem;
}

.sidebar-nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav li.active > a,
.sidebar-nav details[open] summary {
    background: #A52A2A;
    color: #FFF;
}

.sidebar-nav details {
    margin-bottom: 0.5rem;
}

.sidebar-nav summary {
    cursor: pointer;
    font-weight: 600;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-nav ul ul {
    margin: 0.25rem 0 0.25rem 1.25rem;
    padding: 0;
}

.main-content {
    flex: 1;
    padding: 1.6rem 2vw;
    background: #F8F9FA;
    min-height: 100vh;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .layout-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100vw;
        min-width: 0;
        flex-direction: row;
        overflow-x: auto;
        height: 80px;
        padding: 0 1vw;
    }
    .sidebar-logo {
        display: none;
    }
    .sidebar-nav {
        padding: 0;
    }
    .sidebar-nav ul {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
        justify-content: center;
    }
    .main-content {
        padding: 1rem 2vw;
    }
}

/* Dashboard grid layout */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-title {
    margin-bottom: 1.5rem;
}

.dashboard-grid, .dashboard-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.2rem;
    margin-bottom: 1.2rem;
    align-items: stretch;
}

.dashboard-card {
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.07);
    padding: 0.8rem;
    margin-bottom: 0;
    height: 100%;
    min-height: 320px;
    display: flex;
    flex-direction: column;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: white;
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.85rem;
}

th, td {
    padding: 0.35rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #DEE2E6;
}

th {
    background-color: #DC3545;
    color: white;
    font-size: 0.9rem;
}

/* Override for dashboard tables */
.dashboard-table th {
    background: #d32f2f !important;
    color: #000 !important;
    font-weight: bold;
}

tr:hover {
    background-color: #E9ECEF;
}

/* Flashed messages / Errors (compact) */
.alert, .error {
    background-color: #DC3545;
    color: white;
    padding: 0.5rem;
    margin: 0.5rem 0;
    border-radius: 4px;
    position: relative;
    font-size: 0.85rem;
}

.alert.success {
    background-color: #28A745;
}

.btn-link {
    display: inline-block;
    margin: 0.4rem 0 0 0;
    padding: 0.28rem 0.8rem;
    background: linear-gradient(to right, #DC3545, #A52A2A);
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.72rem;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.btn-link:hover {
    background: linear-gradient(to right, #A52A2A, #DC3545);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.7);
}

/* Forms and sections */
form {
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin: 0.75rem auto;
    max-width: 100%;
}

label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: bold;
    color: #DC3545;
    font-size: 0.9rem;
}

input[type="text"], input[type="password"], input[type="number"], select {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    border: 1px solid #CED4DA;
    border-radius: 5px;
    transition: border-color 0.3s ease;
    font-size: 0.9rem;
}

input:focus, select:focus {
    border-color: #DC3545;
}

button, input[type="submit"] {
    background: linear-gradient(to right, #DC3545, #A52A2A);
    color: white;
    border: none;
    padding: 0.35rem 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    font-weight: bold;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

button:hover, input[type="submit"]:hover {
    background: linear-gradient(to right, #A52A2A, #DC3545);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.7);
}

/* Logo specific styles */
.logo {
    width: 150px;
    display: block;
    margin: 0 auto 20px;
    animation: fadeIn 1s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive tweaks */
@media (max-width: 768px) {
    form, table {
        font-size: 0.8rem;
    }
    button {
        padding: 0.3rem 0.6rem;
    }
    .dashboard-grid, .dashboard-admin-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    .dashboard-card {
        min-height: 200px;
    }
    .main-content {
        padding: 0.8rem 1vw;
    }
}

/* Radar Track Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: none;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: #d32f2f;
    text-decoration: none;
}

#radarCanvas {
    border: 2px solid #d32f2f;
    border-radius: 8px;
    background-color: #000;
    display: block;
    margin: 20px auto;
}

#trackDetails {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #d32f2f;
}

.track-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.track-info-item {
    background: white;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.track-info-label {
    font-weight: bold;
    color: #d32f2f;
    font-size: 0.9em;
}

.track-info-value {
    color: #333;
    font-size: 0.95em;
}

/* Object ID styling */
.object-id {
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    color: #d32f2f;
    font-weight: bold;
    padding: 2px 6px;
    background: rgba(211, 47, 47, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(211, 47, 47, 0.3);
}

/* Radar ID styling */
.radar-id {
    font-family: 'Courier New', monospace;
    font-size: 1.0em;
    color: #17a2b8;
    font-weight: bold;
    padding: 2px 6px;
    background: rgba(23, 162, 184, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

/* Enhanced track button styling */
.track-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    border: none;
    color: white;
    font-size: 0.8em;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.track-btn:hover {
    background: linear-gradient(135deg, #138496 0%, #17a2b8 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
}

/* Duration and frame count badges */
.badge-secondary {
    background-color: #6c757d !important;
}

.badge-info {
    background-color: #17a2b8 !important;
}

/* Radar canvas adjustments for 180° scope */
#radarCanvas {
    border: 2px solid #d32f2f;
    border-radius: 8px;
    background-color: #001a00;
    display: block;
    margin: 20px auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Button styles for tables and forms */
.btn {
    background: linear-gradient(to right, #DC3545, #A52A2A);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.8rem;
    text-decoration: none;
    display: inline-block;
    margin: 1px;
    box-shadow: none;
    outline: none;
    border: 1px solid transparent;
}

.btn:hover {
    background: linear-gradient(to right, #A52A2A, #DC3545);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.8rem;
    border-radius: 3px;
}

.btn-primary {
    background: linear-gradient(to right, #007bff, #0056b3);
}

.btn-primary:hover {
    background: linear-gradient(to right, #0056b3, #007bff);
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

.btn-danger {
    background: linear-gradient(to right, #dc3545, #c82333);
}

.btn-danger:hover {
    background: linear-gradient(to right, #c82333, #dc3545);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.4);
}

/* Action buttons container for tables */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    min-width: 180px;
}

.action-buttons .btn {
    white-space: nowrap;
    margin: 0;
}

/* Ensure table cells with buttons have proper spacing */
.dashboard-table td:last-child {
    padding: 8px 10px;
}

/* Fix for inline forms in table cells */
.dashboard-table form {
    display: inline;
    margin: 0;
    padding: 0;
    background: none;
    box-shadow: none;
}