/**
 * Ghost Point GPS Tracking System
 * Main Stylesheet
 * Version: 2.0
 */

/* === Color Variables === */
:root {
    --ghost-primary: #2563eb;
    --ghost-secondary: #1e40af;
    --ghost-dark: #1e293b;
    --ghost-light: #f8fafc;
    --ghost-gradient-start: #667eea;
    --ghost-gradient-end: #764ba2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
}

/* === Global Styles === */
body {
    background: linear-gradient(135deg, var(--ghost-gradient-start) 0%, var(--ghost-gradient-end) 100%);
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* === Navbar === */
.navbar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--ghost-primary) !important;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--ghost-primary) !important;
}

.nav-link.active {
    color: var(--ghost-primary) !important;
    font-weight: 600;
}

/* === Cards === */
.card-modern {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}

.card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* === Stat Cards === */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    overflow: hidden;
    position: relative;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card.primary::before {
    background: linear-gradient(90deg, var(--ghost-gradient-start), var(--ghost-gradient-end));
}

.stat-card.success::before {
    background: linear-gradient(90deg, var(--success-color), #059669);
}

.stat-card.danger::before {
    background: linear-gradient(90deg, var(--danger-color), #dc2626);
}

.stat-card.warning::before {
    background: linear-gradient(90deg, var(--warning-color), #d97706);
}

.stat-card.info::before {
    background: linear-gradient(90deg, var(--info-color), #0891b2);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.stat-icon.primary {
    background: linear-gradient(135deg, var(--ghost-gradient-start) 0%, var(--ghost-gradient-end) 100%);
    color: white;
}

.stat-icon.success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
}

.stat-icon.danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
}

.stat-icon.warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    color: white;
}

.stat-icon.info {
    background: linear-gradient(135deg, var(--info-color) 0%, #0891b2 100%);
    color: white;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
    line-height: 1;
    color: var(--ghost-dark);
}

.stat-label {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Status Badges === */
.status-badge {
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status-online {
    background: #d1fae5;
    color: #065f46;
}

.status-offline {
    background: #fee2e2;
    color: #991b1b;
}

.status-alert {
    background: #fef3c7;
    color: #92400e;
}

.status-inactive {
    background: #f1f5f9;
    color: #475569;
}

/* === Buttons === */
.btn-ghost-primary {
    background: linear-gradient(135deg, var(--ghost-gradient-start) 0%, var(--ghost-gradient-end) 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-ghost-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-ghost-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.btn-ghost-success:hover {
    transform: translateY(-2px);
    color: white;
}

.btn-ghost-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.btn-ghost-danger:hover {
    transform: translateY(-2px);
    color: white;
}

/* === Tables === */
.table-modern {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.table-modern thead th {
    background: #f8fafc;
    color: var(--ghost-dark);
    font-weight: 600;
    border: none;
    padding: 1rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table-modern tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-color: #f1f5f9;
}

.table-modern tbody tr:hover {
    background: #f8fafc;
}

/* === Forms === */
.form-control-modern {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: border-color 0.3s ease;
}

.form-control-modern:focus {
    border-color: var(--ghost-primary);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

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

/* === Page Titles === */
.page-title {
    color: white;
    font-weight: 700;
    margin-bottom: 2rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.page-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    margin-top: 0.5rem;
}

/* === Animations === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

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

.slide-in {
    animation: slideIn 0.5s ease-out;
}

/* === Loading Spinner === */
.spinner-ghost {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    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); }
}

/* === Alerts === */
.alert-modern {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.alert-modern.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert-modern.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert-modern.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

.alert-modern.alert-info {
    background: #cffafe;
    color: #164e63;
}

/* === Modal Customization === */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 2px solid #f1f5f9;
    padding: 1.5rem;
}

.modal-footer {
    border-top: 2px solid #f1f5f9;
    padding: 1.5rem;
}

/* === Device List === */
.device-item {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.device-item:last-child {
    border-bottom: none;
}

.device-item:hover {
    background: #f8fafc;
}

/* === Quick Actions === */
.quick-action-btn {
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    background: white;
    transition: all 0.3s ease;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.quick-action-btn:hover {
    border-color: var(--ghost-primary);
    background: #f8fafc;
    transform: translateY(-2px);
    text-decoration: none;
}

.quick-action-btn i {
    font-size: 2rem;
    color: var(--ghost-primary);
    margin-bottom: 0.5rem;
    display: block;
}

/* === Responsive === */
@media (max-width: 768px) {
    .stat-value {
        font-size: 2rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
}

/* === Utilities === */
.text-ghost-primary {
    color: var(--ghost-primary);
}

.bg-ghost-primary {
    background: linear-gradient(135deg, var(--ghost-gradient-start) 0%, var(--ghost-gradient-end) 100%);
}

.border-ghost-primary {
    border-color: var(--ghost-primary) !important;
}

.shadow-ghost {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.shadow-ghost-lg {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* === Map Container === */
#map {
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* === Chart Container === */
.chart-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.chart-card h5 {
    font-weight: 600;
    color: var(--ghost-dark);
    margin-bottom: 1.5rem;
}
