/* Color Palette & Variables */
:root {
    --bg-main: #040808;
    --bg-darker: #020404;
    --bg-panel: rgba(12, 28, 24, 0.45);
    --bg-panel-hover: rgba(18, 38, 32, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.16);
    
    /* Neon Green gradients */
    --accent-green-bright: #00ff87;
    --accent-green: #10b981;
    --accent-green-dark: #059669;
    --accent-gradient: linear-gradient(135deg, #00ff87 0%, #059669 100%);
    --accent-glow: 0 0 15px rgba(0, 255, 135, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 255, 135, 0.08) 0%, transparent 45%);
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Header & Nav */
.app-header {
    background: rgba(2, 4, 4, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #020404;
    font-size: 1.25rem;
    box-shadow: var(--accent-glow);
}

.logo span span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-nav {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.35rem;
    border-radius: 14px;
    border: 1px solid var(--border-color);
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.7rem 1.2rem;
    border-radius: 10px;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.25s ease;
}

.nav-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    color: #020404;
    background: var(--accent-gradient);
    font-weight: 600;
    box-shadow: var(--accent-glow);
}

/* User Simulator */
.user-simulator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-simulator label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '\f0d7';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

select {
    appearance: none;
    background: rgba(12, 28, 24, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem 2.2rem 0.6rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

select:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 2px rgba(0, 255, 135, 0.2);
}

/* General Layout Elements */
.app-main {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Glass Panels */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    transition: border-color 0.3s, background-color 0.3s;
}

.glass-panel:hover {
    border-color: var(--border-color-hover);
    background-color: var(--bg-panel-hover);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #020404;
    box-shadow: var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(0, 255, 135, 0.6);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.25);
    border-color: #f87171;
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

.btn-block {
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.input-wrapper input,
textarea {
    width: 100%;
    background: rgba(4, 6, 12, 0.5);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: all 0.2s;
}

textarea {
    padding: 0.8rem 1rem;
    resize: vertical;
}

.input-wrapper input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-green);
    background: rgba(4, 6, 12, 0.8);
    box-shadow: 0 0 0 2px rgba(0, 255, 135, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-info-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    padding: 0.8rem;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Map Containers */
.map-container {
    width: 100%;
    height: 480px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* Creator Layout */
.creator-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .creator-grid {
        grid-template-columns: 1fr;
    }
}

.map-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.map-title-wrapper h3 {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.map-title-wrapper p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.map-controls {
    display: flex;
    gap: 0.5rem;
}

/* Custom styles for Leaflet elements inside dark mode */
.leaflet-container {
    background: #040808 !important;
}

.leaflet-tile {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%) !important;
}

.leaflet-bar {
    border: 1px solid var(--border-color) !important;
    box-shadow: none !important;
}

.leaflet-bar a {
    background-color: rgba(12, 28, 24, 0.9) !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-color) !important;
    transition: all 0.2s;
}

.leaflet-bar a:hover {
    background-color: var(--accent-green) !important;
    color: #020404 !important;
}

.leaflet-popup-content-wrapper {
    background: rgba(12, 28, 24, 0.95) !important;
    color: var(--text-primary) !important;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px !important;
}

.leaflet-popup-tip {
    background: rgba(12, 28, 24, 0.95) !important;
}

/* Search Filters & List */
.search-filters {
    margin-bottom: 2rem;
}

.filter-header {
    margin-bottom: 1.5rem;
}

.filter-header h2 {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.filter-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.filters-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 1.5rem;
    align-items: end;
}

@media (max-width: 768px) {
    .filters-grid {
        grid-template-columns: 1fr;
    }
}

.label-with-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#price-slider-value {
    font-weight: 700;
    color: var(--accent-green-bright);
    font-size: 0.95rem;
}

input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    outline: none;
    margin: 0.5rem 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-gradient);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 135, 0.5);
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.checkbox-group {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-bottom: 0.8rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-green);
    cursor: pointer;
}

/* Routes List */
.routes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.route-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.route-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.route-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-full {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.route-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
}

.route-price span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.route-card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.route-cities {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.route-cities i {
    color: var(--accent-green);
    font-size: 0.9rem;
}

.route-date-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.route-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.route-creator-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.capacity-info {
    margin-top: 0.75rem;
}

.capacity-text-wrapper {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.capacity-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.capacity-progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    transition: width 0.3s;
}

.route-card-footer {
    margin-top: 1.25rem;
}

/* User Panel Styling */
.panel-layout {
    display: grid;
    grid-template-columns: 1fr 2.5fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .panel-layout {
        grid-template-columns: 1fr;
    }
}

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--accent-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: var(--accent-green);
    margin-bottom: 1rem;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
}

.profile-card h2 {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.user-role-badge {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.stats-panel {
    display: flex;
    justify-content: space-around;
    padding-top: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent-green);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.panel-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.panel-section h3 {
    font-size: 1.15rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.panel-list-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: background 0.2s;
}

.panel-list-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.item-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
}

.item-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1rem;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

.no-items-placeholder {
    padding: 2.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 6, 12, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeInModalOverlay 0.25s ease-out;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    width: 100%;
    max-width: 900px;
    position: relative;
    padding: 0;
    overflow: hidden;
    animation: scaleInModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeInModalOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleInModal {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr;
    }
    .modal-map-wrapper {
        height: 250px;
    }
}

.modal-map-wrapper {
    height: 100%;
    min-height: 400px;
}

.modal-map-wrapper .map-container {
    height: 100%;
    border-radius: 0;
    border: none;
    border-right: 1px solid var(--border-color);
}

.modal-details {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-date {
    font-size: 0.8rem;
    color: var(--accent-green-bright);
    font-weight: 700;
}

.modal-title-val {
    font-size: 1.5rem;
}

.modal-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.font-gradient {
    font-weight: 700;
}

.font-gradient strong {
    font-size: 1.3rem;
    color: var(--text-primary);
}

.modal-description h4,
.modal-passengers-section h4 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.modal-description p {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.passengers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.seats-left-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.passengers-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.passenger-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.passenger-chip i {
    font-size: 0.75rem;
    color: var(--accent-green);
}

.passenger-chip.is-creator {
    background: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.3);
}

.passenger-chip.is-creator i {
    color: var(--accent-green-bright);
}

.no-passengers {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.modal-actions {
    margin-top: auto;
    padding-top: 1rem;
}

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: rgba(12, 28, 24, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-green);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 500;
    pointer-events: auto;
    min-width: 300px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left-color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast i {
    font-size: 1.1rem;
}

.toast-success i {
    color: #10b981;
}

.toast-error i {
    color: #ef4444;
}

/* Custom leaflet tooltip style */
.map-tooltip {
    background-color: #040808 !important;
    border: 1px solid var(--accent-green) !important;
    color: #fff !important;
    font-weight: bold;
    border-radius: 4px;
    padding: 4px 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
