/* MediLocate Styles */

:root {
    /* Colors */
    --primary: hsl(211, 100%, 56%);
    --primary-foreground: hsl(210, 40%, 98%);
    --destructive: hsl(0, 84%, 60%);
    --destructive-foreground: hsl(210, 40%, 98%);
    --background: hsl(210, 20%, 98%);
    --foreground: hsl(222, 47%, 11%);
    --card: hsl(0, 0%, 100%);
    --card-foreground: hsl(222, 47%, 11%);
    --muted: hsl(210, 16%, 93%);
    --muted-foreground: hsl(215, 16%, 47%);
    --border: hsl(214, 32%, 91%);
    --input: hsl(214, 32%, 85%);
    --ring: hsl(211, 100%, 56%);
    
    /* Specific colors */
    --green: hsl(142, 76%, 36%);
    --purple: hsl(262, 83%, 58%);
    --orange: hsl(20, 91%, 48%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Spacing */
    --radius: 0.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(to bottom, var(--background), var(--muted));
    color: var(--foreground);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
    gap: 1rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), hsl(211, 100%, 66%));
    color: var(--primary-foreground);
}

.logo-text h1 {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: hsl(211, 100%, 46%);
}

.btn-location {
    background: var(--green);
    color: white;
}

.btn-location:hover {
    background: hsl(142, 76%, 30%);
}

.btn-location.disabled {
    background: transparent;
    color: var(--foreground);
    border: 1px solid var(--border);
}

.btn-emergency {
    background: linear-gradient(135deg, var(--destructive), hsl(0, 84%, 70%));
    color: var(--destructive-foreground);
    box-shadow: 0 4px 6px -1px hsl(0 84% 60% / 0.3);
}

.btn-emergency:hover {
    background: hsl(0, 84%, 50%);
}

.btn-outline {
    background: transparent;
    color: var(--foreground);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--muted);
}

.btn-full {
    width: 100%;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-secondary {
    background: var(--muted);
    color: var(--foreground);
}

.badge-secure {
    background: hsla(142, 76%, 36%, 0.1);
    color: var(--green);
    border: 1px solid hsla(142, 76%, 36%, 0.2);
}

/* Cards */
.card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 1rem;
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.card-description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.card-content {
    margin-top: 1rem;
}

/* Main */
.main {
    padding: 1.5rem 0;
}

/* Search */
.search-card {
    margin-bottom: 1.5rem;
}

.search-container {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    min-width: 200px;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--muted-foreground);
}

.search-input {
    width: 100%;
    padding: 0.625rem 0.75rem 0.625rem 2.5rem;
    border: 1px solid var(--input);
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: var(--background);
}

.search-input:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 3px hsla(211, 100%, 56%, 0.1);
}

/* Emergency Alert */
.emergency-alert {
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--destructive);
    background: hsla(0, 84%, 60%, 0.05);
}

.alert-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--destructive);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.alert-text h3 {
    font-weight: 600;
    color: var(--destructive);
    margin-bottom: 0.25rem;
}

.alert-text p {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Section Titles */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-title i {
    color: var(--primary);
    width: 1.25rem;
    height: 1.25rem;
}

/* Service Filters */
.service-filters {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.service-filter-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.service-filter-btn:hover {
    box-shadow: var(--shadow);
    border-color: hsla(211, 100%, 56%, 0.5);
}

.service-filter-btn.active {
    background: linear-gradient(135deg, var(--primary), hsl(211, 100%, 66%));
    color: var(--primary-foreground);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.service-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.375rem;
    flex-shrink: 0;
}

.service-icon i {
    width: 1.25rem;
    height: 1.25rem;
    color: white;
}

.service-icon.all { background: var(--primary); }
.service-icon.hospital { background: var(--destructive); }
.service-icon.pharmacy { background: var(--green); }
.service-icon.lab { background: var(--purple); }
.service-icon.blood_bank { background: var(--destructive); }
.service-icon.veterinary { background: var(--orange); }

.service-filter-btn.active .service-icon {
    background: hsla(210, 40%, 98%, 0.2);
}

.service-info h4 {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.service-info p {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Map */
.map-card {
    height: 600px;
    display: flex;
    flex-direction: column;
}

.map-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.map-container {
    flex: 1;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* Service List */
.service-list-card {
    height: 600px;
    display: flex;
    flex-direction: column;
}

.service-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.service-list-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.service-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.service-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    background: var(--card);
    transition: box-shadow 0.2s;
}

.service-item:hover {
    box-shadow: var(--shadow);
}

.service-item-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.service-item-info {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    flex: 1;
}

.service-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.service-item-icon i {
    width: 1.25rem;
    height: 1.25rem;
    color: white;
}

.service-item-details {
    flex: 1;
    min-width: 0;
}

.service-item-details h3 {
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.service-item-details .type {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 0.5rem;
}

.service-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.service-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.service-meta-item i {
    width: 0.75rem;
    height: 0.75rem;
}

.badge-status {
    flex-shrink: 0;
}

.badge-status.open {
    background: var(--green);
    color: white;
}

.badge-status.closed {
    background: var(--muted);
    color: var(--muted-foreground);
}

.service-item-address {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.address-item {
    display: flex;
    align-items: start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.address-item i {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.service-item-actions {
    display: flex;
    gap: 0.5rem;
}

.service-item-actions .btn {
    flex: 1;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    text-align: center;
    padding: 1.5rem 1rem;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-value.stat-primary { color: var(--primary); }
.stat-value.stat-success { color: var(--green); }
.stat-value.stat-destructive { color: var(--destructive); }
.stat-value.stat-purple { color: var(--purple); }

.stat-label {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* Auth Page */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.auth-container {
    width: 100%;
    max-width: 28rem;
}

.auth-card {
    padding: 1.5rem;
}

.tabs {
    width: 100%;
}

.tabs-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    background: var(--muted);
    border-radius: var(--radius);
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}

.tabs-trigger {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    border-radius: calc(var(--radius) - 0.25rem);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    color: var(--muted-foreground);
}

.tabs-trigger:hover {
    color: var(--foreground);
}

.tabs-trigger.active {
    background: var(--card);
    color: var(--foreground);
    box-shadow: var(--shadow-sm);
}

.tabs-content {
    display: none;
}

.tabs-content.active {
    display: block;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.label {
    font-size: 0.875rem;
    font-weight: 500;
}

.input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--input);
    border-radius: var(--radius);
    background: var(--background);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.input:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px hsla(211, 100%, 56%, 0.2);
}

.input::placeholder {
    color: var(--muted-foreground);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    max-width: 20rem;
    display: none;
    animation: slideIn 0.3s ease-out;
}

.toast.show {
    display: block;
}

.toast.error {
    border-color: var(--destructive);
    background: hsla(0, 84%, 60%, 0.1);
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.toast-description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Admin Page */
.admin-page {
    padding: 1rem;
}

.admin-container {
    max-width: 80rem;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--primary-foreground);
}

.admin-title {
    font-size: 1.875rem;
    font-weight: 700;
}

.status-box {
    padding: 1rem;
    background: var(--muted);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.status-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.status-text {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.stats-grid-admin {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card-title {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-btn {
        display: none;
    }
}

@media (max-width: 640px) {
    .desktop-text {
        display: none;
    }
    
    .mobile-text {
        display: inline;
    }
    
    .badge-secure {
        display: none;
    }
    
    .location-text {
        display: none;
    }
}

@media (min-width: 641px) {
    .mobile-text {
        display: none;
    }
}
