/* GACS Dashboard Custom Styles */

:root {
    --primary-color: #2d6a4f;
    --secondary-color: #6c757d;
    --success-color: #52b788;
    --danger-color: #d62828;
    --warning-color: #f77f00;
    --info-color: #0077b6;
    --dark-color: #1b4332;
    --light-color: #f1faee;
    --sidebar-width: 250px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%);
    min-height: 100vh;
    zoom: 85%;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: #275D45;
    color: white;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
    word-wrap: break-word;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-menu li {
    margin: 0.5rem 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left: 3px solid white;
    padding-left: calc(1rem - 3px);
}

.sidebar-menu i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-menu span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--light-color);
}

.topbar {
    background: white;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar h4 {
    margin: 0;
    color: var(--dark-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.content-wrapper {
    padding: 2rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%);
    color: white;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Stats Cards */
.stats-grid {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: nowrap;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.3s;
    flex: 1 1 0;
    min-width: 0;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card.primary {
    border-top: 3px solid var(--primary-color);
}

.stat-card.success {
    border-top: 3px solid var(--success-color);
}

.stat-card.danger {
    border-top: 3px solid var(--danger-color);
}

.stat-card.warning {
    border-top: 3px solid var(--warning-color);
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.3;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.stat-info {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.stat-info h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-info p {
    margin: 0.25rem 0 0 0;
    color: var(--secondary-color);
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: var(--light-color);
}

table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
}

table td {
    padding: 1rem;
    border-bottom: 1px solid #e3e6f0;
}

table tbody tr:hover {
    background: var(--light-color);
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge.online {
    background: var(--success-color);
    color: white;
}

.badge.offline {
    background: var(--danger-color);
    color: white;
}

/* Buttons */
.btn {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1b4332;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #40916c;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #9d0208;
}

.btn-sm {
    padding: 0.35rem 1rem;
    font-size: 0.9rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d3e2;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--secondary-color);
}

/* Footer */
.footer {
    background: white;
    padding: 1.5rem;
    text-align: center;
    color: var(--secondary-color);
    margin-top: 2rem;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    text-decoration: underline;
}

/* Map Styles */
#map {
    height: 600px;
    border-radius: 10px;
    overflow: hidden;
}

/* Alert Styles */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d8f3dc;
    color: #1b4332;
    border: 1px solid #95d5b2;
}

.alert-danger {
    background: #ffe5e5;
    color: #6a040f;
    border: 1px solid #ffc2c2;
}

.alert-warning {
    background: #ffe8cc;
    color: #995300;
    border: 1px solid #ffcc80;
}

.alert-info {
    background: #caf0f8;
    color: #023e8a;
    border: 1px solid #90e0ef;
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid {
        flex-wrap: wrap;
    }

    .stat-card {
        flex: 1 1 calc(50% - 0.25rem);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        flex-wrap: wrap;
    }

    .stat-card {
        flex: 1 1 100%;
    }
}
