/* Basic Setup */
:root {
    --primary: #2c3e50;
    --secondary: #34495e;
    --accent: #3498db;
    --text: #ecf0f1;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', user-select, sans-serif;
}

body {
    height: 100vh;
    overflow: hidden;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Page */
.login-page {
    background: var(--bg-gradient);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 380px;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.login-container h1 {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #ddd;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    font-weight: bold;
    color: #7f8c8d;
    cursor: pointer;
    transition: 0.3s;
}

.tab-btn.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    margin-bottom: -2px;
}

/* Form Styles */
.input-group {
    margin-bottom: 1rem;
    position: relative;
}

.input-group .icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: 0.3s;
}

input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #2980b9;
}

.message.error {
    color: #e74c3c;
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Role Selection */
.role-selector {
    margin-bottom: 1rem;
}

.radio-group {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.radio-card {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    text-align: center;
    transition: 0.2s;
    color: #555;
    position: relative;
}

.radio-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card.selected {
    border-color: var(--accent);
    background: rgba(52, 152, 219, 0.1);
    color: var(--accent);
    font-weight: bold;
}

.radio-card:hover {
    border-color: #bbb;
}

/* Color Picker */
.color-picker {
    text-align: left;
    margin-bottom: 1rem;
}

.color-picker label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--secondary);
    font-size: 0.9rem;
}

.colors {
    display: flex;
    gap: 10px;
}

.color-option {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #333;
    transform: scale(1.1);
}

/* Dashboard Layout */
.app-layout {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 350px;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

#map {
    flex: 1;
    z-index: 1;
}

/* Sidebar Components */
.user-profile {
    padding: 1.5rem;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.role-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-top: 5px;
    display: inline-block;
}

.avatar-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid white;
    font-size: 1.2rem;
}

.btn-icon {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: auto;
    opacity: 0.7;
    transition: 0.3s;
}

.btn-icon:hover {
    opacity: 1;
    transform: translateX(2px);
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Action Panel (Request button etc) */
.action-panel {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.action-panel h3 {
    margin-bottom: 5px;
    color: var(--primary);
}

.action-panel p {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.status-card {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.status-card.on-way {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

/* Lists */
.lists-container h4 {
    color: var(--secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.user-item:hover {
    background: #f1f2f6;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    margin-right: 12px;
    font-size: 0.9rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-details .username {
    font-weight: 600;
    color: var(--secondary);
}

.user-details .status-text {
    font-size: 0.75rem;
    color: #95a5a6;
}

/* Request Cards (For Messenger) */
.request-card {
    background: white;
    border: 1px solid #ddd;
    border-left: 4px solid var(--accent);
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.request-card strong {
    display: block;
    color: var(--primary);
}

.request-card p {
    font-size: 0.9rem;
    color: #666;
    margin: 5px 0 10px 0;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
    width: auto;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    position: relative;
    animation: fadeIn 0.3s;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #aaa;
}

textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: vertical;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column-reverse;
    }

    .sidebar {
        width: 100%;
        height: 35vh;
        border-radius: 20px 20px 0 0;
        position: relative;
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
        z-index: 2000;
    }

    #map {
        height: 65vh;
    }

    .user-profile {
        padding: 0.8rem 1.5rem;
        border-radius: 20px 20px 0 0;
    }

    .panel-content {
        padding: 1rem;
    }
}