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

:root {
    /* Claude Light Theme Colors */
    --primary: #CC785C;
    --primary-dark: #B5663F;
    --primary-light: #D97757;
    --bg: #F5F5F0;
    --surface: #FEFDFB;
    --text-primary: #2C2416;
    --text-secondary: #73685D;
    --border: #E0DDD5;
    --success: #10B981;
    --success-light: #D1FAE5;
    --error: #DC2626;
    --error-light: #FEE2E2;
    --warning: #D97706;
    --warning-light: #FEF3C7;
    --shadow-sm: 0 1px 2px 0 rgba(44, 36, 22, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(44, 36, 22, 0.1), 0 2px 4px -2px rgba(44, 36, 22, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(44, 36, 22, 0.1), 0 4px 6px -4px rgba(44, 36, 22, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(44, 36, 22, 0.1), 0 8px 10px -6px rgba(44, 36, 22, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 1.5rem 1rem 2rem;
    text-align: center;
    color: white;
    box-shadow: var(--shadow-md);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo svg rect {
    fill: white;
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
}

.tagline {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* Search Section */
.search-section {
    background: var(--surface);
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.input-label svg {
    color: var(--primary);
}

/* Pincode Input */
#pincodeInput {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s;
    background: var(--surface);
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--text-primary);
}

#pincodeInput:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(16, 132, 126, 0.1);
}

#pincodeInput.error {
    border-color: var(--error);
}

#pincodeInput.success {
    border-color: var(--success);
}

.input-error {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: var(--error-light);
    border-radius: 8px;
    font-size: 0.8125rem;
    color: var(--error);
}

.input-error svg {
    flex-shrink: 0;
}

.pincode-info {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: var(--success-light);
    border-radius: 8px;
    font-size: 0.8125rem;
    color: var(--success);
    font-weight: 500;
}

.pincode-info svg {
    flex-shrink: 0;
}

/* Search Box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
}

#medicineSearch {
    width: 100%;
    padding: 0.875rem 3rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s;
    background: var(--surface);
    color: var(--text-primary);
}

#medicineSearch:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(16, 132, 126, 0.1);
}

.clear-btn {
    position: absolute;
    right: 0.5rem;
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    display: none;
    transition: all 0.2s;
    border-radius: 8px;
}

.clear-btn.visible {
    display: block;
}

.clear-btn:hover {
    background: var(--bg);
    color: var(--text-primary);
}

.clear-btn:active {
    transform: scale(0.9);
}

/* Search Button */
.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.search-btn:hover:not(:disabled) {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

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

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

/* Suggestions */
.suggestions {
    margin-top: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: none;
}

.suggestions.visible {
    display: block;
}

.suggestion-item {
    padding: 0.875rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

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

.suggestion-item:hover {
    background: var(--bg);
}

.suggestion-item strong {
    color: var(--primary);
    font-weight: 600;
}

/* Results Section */
.results-section {
    flex: 1;
    padding: 1.5rem 1rem;
    background: var(--bg);
}

.results-header {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.results-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.results-medicine {
    color: var(--primary);
}

.highlight {
    color: var(--primary);
    font-weight: 700;
}

.results-location {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.results-location svg {
    color: var(--primary);
}

.results-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Pharmacy List */
.pharmacy-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pharmacy-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.125rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pharmacy-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.pharmacy-card:active {
    transform: translateY(0);
}

.pharmacy-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.pharmacy-info {
    flex: 1;
}

.pharmacy-name {
    font-weight: 700;
    font-size: 1.0625rem;
    margin-bottom: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.availability {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    padding: 0.1875rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.availability.best-price {
    background: #DBEAFE;
    color: #1E40AF;
}

.pharmacy-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.pharmacy-price {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--primary);
}

.pharmacy-discount {
    display: inline-block;
    background: var(--success-light);
    color: var(--success);
    padding: 0.125rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.pharmacy-arrow {
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* Empty State */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem;
}

.empty-icon {
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.empty-description {
    color: var(--text-secondary);
    max-width: 360px;
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* How It Works */
.how-it-works {
    width: 100%;
    max-width: 400px;
    background: var(--bg);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.how-it-works h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

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

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

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.step-content {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.step-content strong {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 600;
}

.step-content span {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Popular Searches */
.popular-searches {
    margin-top: 1.5rem;
    width: 100%;
}

.popular-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.popular-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    justify-content: center;
}

.chip {
    padding: 0.625rem 1.125rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.chip:active {
    transform: translateY(0);
}

/* No Results */
.no-results {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem;
}

.no-results svg {
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.try-again-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.try-again-btn:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.try-again-btn:active {
    transform: translateY(0);
}

/* Footer */
.footer {
    padding: 1.5rem 1rem;
    text-align: center;
    background: var(--bg);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.footer p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.footer-note {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Responsive */
@media (min-width: 640px) {
    .header {
        padding: 2rem 1.5rem 2.5rem;
    }

    .search-section {
        padding: 2rem 1.5rem;
    }

    .results-section {
        padding: 2rem 1.5rem;
    }

    .pharmacy-card {
        padding: 1.25rem;
    }

    .pharmacy-icon {
        width: 64px;
        height: 64px;
    }

    .empty-state {
        padding: 3rem 2rem;
    }
}

/* Touch Optimization */
@media (hover: none) and (pointer: coarse) {
    .pharmacy-card:hover {
        transform: none;
    }

    .pharmacy-card:active {
        background: var(--bg);
        transform: scale(0.98);
    }

    .search-btn:hover:not(:disabled) {
        transform: none;
    }
}

/* Dark Mode Support (disabled - using light theme only) */
@media (prefers-color-scheme: dark) {
    /* Keep light theme even in dark mode preference */
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
