/**
 * My Bookings Page Styles
 * Veranda Market Services
 */

/* ===================================
   CSS VARIABLES
   =================================== */
:root {
    --primary-color: #1a8917;
    --primary-hover: #156912;
    --primary-light: rgba(26, 137, 23, 0.1);
    --secondary-color: #ff6b35;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    --transition: all 0.2s ease;
    --font-primary: 'Inter', sans-serif;
    --font-secondary: 'Space Grotesk', sans-serif;

    /* Status Colors */
    --status-pending: #F59E0B;
    --status-pending-bg: #FEF3C7;
    --status-confirmed: #10B981;
    --status-confirmed-bg: #D1FAE5;
    --status-completed: #3B82F6;
    --status-completed-bg: #DBEAFE;
    --status-cancelled: #EF4444;
    --status-cancelled-bg: #FEE2E2;

    /* WhatsApp */
    --whatsapp-color: #25D366;
    --whatsapp-hover: #1da851;
}

/* ===================================
   BASE STYLES
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ===================================
   HEADER
   =================================== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.top-nav {
    padding: 0.75rem 0;
}

.top-nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    color: var(--gray-700);
    text-decoration: none;
    transition: var(--transition);
}

.back-btn:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.brand {
    flex: 1;
    display: flex;
    justify-content: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.brand-text h1 {
    font-size: 1.125rem;
    font-weight: 700;
    font-family: var(--font-secondary);
}

.brand-v {
    color: var(--primary-color);
}

.brand-m {
    color: var(--gray-800);
}

.header-spacer {
    width: 40px;
}

/* ===================================
   MAIN CONTENT
   =================================== */
.my-bookings-main {
    padding: 1.5rem 0 3rem;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-secondary);
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.page-subtitle {
    font-size: 0.9375rem;
    color: var(--gray-500);
}

/* ===================================
   SEARCH SECTION
   =================================== */
.search-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2rem 1.5rem;
    text-align: center;
}

.search-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.search-title {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-secondary);
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.search-description {
    font-size: 0.9375rem;
    color: var(--gray-500);
    margin-bottom: 1.5rem;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

/* Form Styles */
.search-form {
    max-width: 320px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

.phone-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.phone-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.phone-prefix {
    padding: 0.75rem 0.75rem;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.9375rem;
    font-weight: 500;
    border-right: 1px solid var(--gray-300);
}

.phone-input-wrapper input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    font-size: 0.9375rem;
    color: var(--gray-900);
    outline: none;
}

.phone-input-wrapper input::placeholder {
    color: var(--gray-400);
}

.field-error {
    display: block;
    font-size: 0.8125rem;
    color: var(--status-cancelled);
    margin-top: 0.25rem;
    min-height: 1.25rem;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-search {
    width: 100%;
    margin-top: 0.5rem;
}

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

/* ===================================
   RESULTS SECTION
   =================================== */
.results-section {
    margin-top: 1.5rem;
}

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

.results-title {
    font-size: 1.125rem;
    font-weight: 700;
    font-family: var(--font-secondary);
    color: var(--gray-900);
}

.btn-new-search {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

/* ===================================
   BOOKING CARD
   =================================== */
.booking-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.booking-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.provider-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--gray-200);
    overflow: hidden;
    flex-shrink: 0;
}

.provider-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.provider-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
}

.provider-info {
    flex: 1;
    min-width: 0;
}

.provider-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.provider-profession {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.booking-card-body {
    padding: 1rem;
}

.booking-detail {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.booking-detail:last-child {
    margin-bottom: 0;
}

.booking-detail i {
    color: var(--gray-400);
    width: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.booking-detail span {
    color: var(--gray-600);
}

.booking-description {
    color: var(--gray-700);
    font-style: italic;
}

/* Status Badge */
.booking-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: capitalize;
}

.status-badge.pending {
    background: var(--status-pending-bg);
    color: var(--status-pending);
}

.status-badge.confirmed {
    background: var(--status-confirmed-bg);
    color: var(--status-confirmed);
}

.status-badge.completed {
    background: var(--status-completed-bg);
    color: var(--status-completed);
}

.status-badge.cancelled {
    background: var(--status-cancelled-bg);
    color: var(--status-cancelled);
}

.status-badge i {
    font-size: 0.75rem;
}

/* Contact Actions */
.contact-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-whatsapp {
    background: var(--whatsapp-color);
    color: var(--white);
}

.btn-whatsapp:hover {
    background: var(--whatsapp-hover);
}

.btn-call {
    background: var(--primary-color);
    color: var(--white);
}

.btn-call:hover {
    background: var(--primary-hover);
}

/* ===================================
   EMPTY STATE
   =================================== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.empty-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9375rem;
    color: var(--gray-500);
    margin-bottom: 1.5rem;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

/* ===================================
   LOADING STATE
   =================================== */
.loading-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state p {
    font-size: 0.9375rem;
    color: var(--gray-500);
}

/* ===================================
   TOAST
   =================================== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-900);
    color: var(--white);
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.error {
    background: var(--status-cancelled);
}

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

/* ===================================
   RESPONSIVE
   =================================== */
@media (min-width: 640px) {
    .container {
        padding: 0 1.5rem;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .search-card {
        padding: 2.5rem 2rem;
    }

    .search-form {
        max-width: 360px;
    }

    .booking-card-header {
        padding: 1.25rem;
    }

    .booking-card-body {
        padding: 1.25rem;
    }

    .booking-card-footer {
        padding: 1rem 1.25rem;
    }
}

/* ===================================
   ACCESSIBILITY
   =================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
