* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 650px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 2em;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 0.95em;
}

h2 {
    color: #555;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.form-section {
    margin-bottom: 30px;
}

#providerForm {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.95em;
}

.field-hint {
    color: #888;
    font-size: 0.8em;
    margin-top: 4px;
}

input, select {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
}

select {
    cursor: pointer;
    background-color: white;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
    padding: 8px;
    transition: background 0.2s;
}

.checkbox-group label:hover {
    background: #e9ecef;
    border-radius: 4px;
}

.checkbox-group input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    padding: 0;
}

button {
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

.profile-section {
    margin-top: 20px;
}

.profile-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #dee2e6;
}

.profile-header h3 {
    color: #333;
    font-size: 1.5em;
    margin: 0;
}

.service-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-details p {
    color: #555;
    font-size: 1em;
    line-height: 1.6;
}

.profile-details strong {
    color: #333;
}

.profile-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.edit-btn {
    background: #6c757d;
}

.edit-btn:hover {
    background: #5a6268;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.dashboard-link-btn {
    display: inline-block;
    padding: 14px 24px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

/* Booking URL Section */
.booking-url-section {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid #2196f3;
}

.booking-url-section h3 {
    color: #1565c0;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.booking-url-label {
    color: #424242;
    margin-bottom: 12px;
    font-size: 0.95em;
}

.booking-url-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#bookingUrlInput {
    flex: 1;
    padding: 12px;
    border: 2px solid #2196f3;
    border-radius: 8px;
    font-size: 14px;
    font-family: monospace;
    background: white;
}

.copy-btn {
    padding: 12px 24px;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #1976d2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.url-hint {
    color: #616161;
    font-size: 0.85em;
    font-style: italic;
    margin: 0;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.5em;
    }

    .profile-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .service-badge {
        align-self: flex-start;
    }
}

/* Auth Page Styles */
.auth-container {
    max-width: 450px;
}

.auth-section {
    margin-top: 20px;
}

.auth-section h2 {
    text-align: center;
    margin-bottom: 25px;
}

.auth-section form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-switch {
    text-align: center;
    margin-top: 25px;
    color: #666;
}

.auth-switch a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9em;
}

.success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9em;
}

/* Password Toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 45px;
    box-sizing: border-box;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    opacity: 1;
    box-shadow: none;
    background: none;
}

.eye-icon {
    width: 20px;
    height: 20px;
    color: #555;
}

.password-toggle.showing {
    opacity: 1;
}

.password-toggle.showing .eye-open {
    display: none;
}

.password-toggle.showing .eye-closed {
    display: block !important;
}

/* Dashboard Header with Logout */
.dashboard-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.dashboard-header-bar h1 {
    margin: 0;
    text-align: left;
}

.logout-btn {
    padding: 10px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Profile Setup Banner */
.verify-banner {
    background: #cce5ff;
    border: 1px solid #b8daff;
    color: #004085;
    border-radius: 10px;
    padding: 12px 20px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.95em;
}

.verify-banner a {
    color: #004085;
    font-weight: 600;
}

.setup-banner {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
}

.setup-banner h3 {
    color: #856404;
    margin-bottom: 10px;
}

.setup-banner p {
    color: #856404;
    margin-bottom: 15px;
}

.setup-btn {
    background: linear-gradient(135deg, #ffc107 0%, #ffca2c 100%);
    color: #333;
}

.setup-btn:hover {
    background: linear-gradient(135deg, #e0a800 0%, #d39e00 100%);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

/* Dashboard Styles */
.dashboard-container {
    max-width: 900px;
}

.dashboard-header {
    margin-bottom: 25px;
}

/* Provider Info Card */
.provider-info-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.provider-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.provider-info-header h3 {
    margin: 0;
    color: #333;
}

.provider-info-details {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 0.9em;
}

.provider-info-loading {
    color: #666;
    text-align: center;
    padding: 10px;
}

/* Filter Section */
.filter-section {
    margin-bottom: 25px;
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.date-filter label {
    font-weight: 600;
    color: #555;
}

.secondary-btn {
    padding: 10px 20px;
    background: #6c757d;
    font-size: 14px;
}

.secondary-btn:hover {
    background: #5a6268;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

/* Bookings Section */
.bookings-section {
    margin-bottom: 30px;
}

.bookings-section h2 {
    margin-bottom: 20px;
}

.bookings-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.booking-date-group {
    border-left: 4px solid #667eea;
    padding-left: 15px;
}

.booking-date {
    color: #333;
    font-size: 1.1em;
    margin-bottom: 15px;
}

.booking-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Booking Card */
.booking-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    display: grid;
    grid-template-columns: 80px 1fr auto auto;
    gap: 15px;
    align-items: center;
    transition: box-shadow 0.2s;
}

.booking-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.booking-confirmed {
    border-left: 4px solid #28a745;
}

.booking-cancelled {
    border-left: 4px solid #dc3545;
    opacity: 0.7;
}

.booking-completed {
    border-left: 4px solid #17a2b8;
    background: #f8f9fa;
}

.booking-time {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

.booking-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.client-name {
    font-weight: 600;
    color: #333;
}

.client-contact {
    display: flex;
    gap: 15px;
    color: #666;
    font-size: 0.85em;
}

.client-address {
    color: #666;
    font-size: 0.85em;
}

.booking-status {
    text-align: center;
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: capitalize;
}

.status-confirmed {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.status-completed {
    background: #d1ecf1;
    color: #0c5460;
}

.booking-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.complete-btn {
    background: #17a2b8;
    color: white;
}

.complete-btn:hover {
    background: #138496;
}

.cancel-btn {
    background: #dc3545;
    color: white;
}

.cancel-btn:hover {
    background: #c82333;
}

.confirm-btn {
    background: #28a745;
    color: white;
}

.confirm-btn:hover {
    background: #218838;
}

.delete-btn {
    background: #6c757d;
    color: white;
}

.delete-btn:hover {
    background: #5a6268;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-hint {
    font-size: 0.9em;
    margin-top: 10px;
    color: #999;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.error-message {
    text-align: center;
    padding: 20px;
    color: #dc3545;
}

/* Add Booking Section */
.add-booking-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}

.add-booking-section h2 {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

/* Navigation */
.nav-section {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.nav-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.nav-link:hover {
    text-decoration: underline;
}

/* Dashboard Mobile Responsive */
@media (max-width: 768px) {
    .booking-card {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .booking-time {
        font-size: 1em;
    }

    .client-contact {
        flex-direction: column;
        gap: 2px;
    }

    .booking-actions {
        justify-content: flex-start;
    }

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

    .date-filter {
        flex-direction: column;
        align-items: flex-start;
    }

    .provider-info-details {
        flex-direction: column;
        gap: 5px;
    }
}

/* Booking Page Styles */
.booking-container {
    max-width: 800px;
}

.booking-header {
    text-align: center;
    margin-bottom: 30px;
}

.booking-header h1 {
    margin-bottom: 5px;
}

/* Calendar Section */
.calendar-section {
    margin-bottom: 30px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5em;
}

.month-nav-btn {
    padding: 12px 22px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.month-nav-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    color: #555;
    padding: 10px;
    font-size: 0.9em;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.95em;
}

.calendar-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.calendar-day.past {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    border-color: #e0e0e0;
}

.calendar-day.unavailable {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
    border-color: #e0e0e0;
}

.calendar-day.available {
    background: white;
    color: #333;
    border-color: #667eea;
}

.calendar-day.available:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

.calendar-day.has-slots {
    background: #e8f5e9;
    border-color: #4caf50;
    font-weight: 600;
}

.calendar-day.has-slots:hover {
    background: #4caf50;
    color: white;
}

.calendar-day.no-slots {
    background: #fff3cd;
    border-color: #ffc107;
    cursor: not-allowed;
}

.calendar-day.today {
    border-width: 3px;
    font-weight: 700;
}

.calendar-day.today.available {
    border-color: #28a745;
}

/* Time Slots Section */
.time-slots-section {
    margin-bottom: 30px;
}

.time-slots-section h3 {
    margin-bottom: 20px;
    color: #333;
}

.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.time-slot-btn {
    padding: 12px 20px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    color: #667eea;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.time-slot-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Booking Form Section */
.booking-form-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}

.booking-form-section h3 {
    margin-bottom: 20px;
    color: #333;
}

.selected-time-display {
    padding: 12px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 15px;
}

.submit-btn {
    width: 100%;
    margin-bottom: 10px;
}

.form-button-row {
    display: flex;
    gap: 10px;
}

.form-button-row button {
    flex: 1;
}

.cancel-booking-btn {
    background: #6c757d;
}

.cancel-booking-btn:hover {
    background: #5a6268;
}

/* Success Message */
.success-message {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-bottom: 25px;
}

.success-message h3 {
    color: #155724;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.success-message p {
    color: #155724;
    margin-bottom: 10px;
}

#bookingDetails {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    text-align: left;
    color: #333;
}

/* Booking Page Mobile Responsive */
@media (max-width: 768px) {
    .calendar-header {
        flex-direction: column;
        gap: 15px;
    }

    .calendar-header h2 {
        order: -1;
    }

    .calendar-grid {
        gap: 4px;
        padding: 10px;
    }

    .calendar-day {
        font-size: 0.85em;
        padding: 5px;
    }

    .time-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .time-slot-btn {
        padding: 10px 15px;
        font-size: 0.9em;
    }
}

/* Services Section Styles */
.services-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.services-intro {
    color: #666;
    margin-bottom: 25px;
    font-size: 0.95em;
}

.no-services {
    color: #999;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* Service Card */
.service-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.service-info h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.service-info p {
    color: #555;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.service-booking-url {
    margin: 15px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.service-booking-url label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.service-booking-url .booking-url-container {
    display: flex;
    gap: 10px;
}

.service-booking-url input {
    flex: 1;
    padding: 10px;
    border: 2px solid #667eea;
    border-radius: 6px;
    font-size: 0.85em;
    font-family: monospace;
    background: #f8f9fa;
}

.service-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.delete-btn {
    background: #dc3545;
}

.delete-btn:hover {
    background: #c82333;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Add Service Form */
.add-service-form {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-top: 25px;
}

.add-service-form h3 {
    color: #333;
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Custom Hours Container */
.custom-hours-container {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

.custom-hours-container h4 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1em;
}

/* Service Form Actions */
.service-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.cancel-btn {
    background: #6c757d;
}

.cancel-btn:hover {
    background: #5a6268;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

/* Booking Service Name in Dashboard */
.booking-service-name {
    color: #667eea;
    font-weight: 600;
    font-size: 0.9em;
    margin-bottom: 4px;
}

/* Service Duration on Booking Page */
.service-duration {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

/* Visit Type Selector */
.visit-type-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.visit-type-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.visit-type-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.visit-type-option input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
}

.visit-type-option input[type="radio"]:checked + .visit-type-label {
    color: #667eea;
}

.visit-type-option:has(input:checked) {
    border-color: #667eea;
    background: #f0f4ff;
}

.visit-type-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.visit-type-label strong {
    font-size: 1em;
    color: #333;
}

.visit-type-location {
    font-size: 0.9em;
    color: #666;
}

.visit-type-desc {
    font-size: 0.85em;
    color: #888;
}

#homeAddressGroup {
    width: 100%;
}

#homeAddressGroup input {
    width: 100%;
    box-sizing: border-box;
}

/* Phone Input with Country Code */
.phone-input-group {
    display: flex;
    gap: 10px;
}

.country-code-wrapper {
    position: relative;
    min-width: 180px;
    flex-shrink: 0;
}

.country-search {
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
}

.country-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 2px solid #667eea;
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.country-dropdown.open {
    display: block;
}

.country-option {
    padding: 14px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.country-option:hover,
.country-option.highlighted {
    background: #f0f4ff;
}

.country-option .country-flag {
    font-size: 1.2em;
}

.country-option .country-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.country-option .country-code {
    color: #666;
    font-size: 0.9em;
}

.no-results {
    padding: 12px;
    color: #666;
    text-align: center;
    font-style: italic;
}

.phone-input-group input[type="tel"] {
    flex: 1;
    min-width: 0;
}

@media (max-width: 480px) {
    .phone-input-group {
        flex-direction: column;
    }

    .country-code-wrapper {
        width: 100%;
    }
}

/* Warning Message */
.warning-message {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #856404;
}

.warning-message p {
    margin-bottom: 10px;
}

/* Services Section Mobile Responsive */
@media (max-width: 768px) {
    .service-booking-url .booking-url-container {
        flex-direction: column;
    }

    .service-actions {
        flex-direction: column;
    }

    .service-form-actions {
        flex-direction: column;
    }

    .service-form-actions button {
        width: 100%;
    }
}

/* Work Locations Link Card (Dashboard) */
.work-locations-link-card {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.work-locations-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border-left: 4px solid #667eea;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.2s;
}

.work-locations-link:hover {
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.25);
    transform: translateY(-2px);
}

.work-locations-link-content h3 {
    color: #333;
    margin-bottom: 4px;
    font-size: 1.1em;
}

.work-locations-link-content p {
    color: #666;
    font-size: 0.9em;
}

.work-locations-arrow {
    font-size: 1.5em;
    color: #667eea;
    font-weight: bold;
}

/* Back Link */
.back-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 0.7;
}

/* Week Visualizer */
.week-visualizer {
    margin-bottom: 30px;
}

.week-visualizer h2 {
    margin-bottom: 15px;
}

.week-grid-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.week-grid {
    min-width: 400px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

/* Header row: corner + day labels */
.wg-header {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
}

.wg-corner {
    width: 52px;
    min-width: 52px;
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
}

.wg-day-header {
    flex: 1;
    background: #f8f9fa;
    padding: 10px 4px;
    text-align: center;
    font-weight: 700;
    font-size: 0.85em;
    color: #555;
    border-right: 1px solid #eee;
}

.wg-day-header:last-child {
    border-right: none;
}

/* Body: hours column + day columns */
.wg-body {
    display: flex;
}

.wg-hours-col {
    width: 52px;
    min-width: 52px;
    border-right: 1px solid #e0e0e0;
}

.wg-hour-label {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 2px 6px 0 4px;
    font-size: 0.72em;
    color: #888;
    white-space: nowrap;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    box-sizing: border-box;
}

/* Each day column: position relative so blocks overlay */
.wg-day-col {
    flex: 1;
    position: relative;
    border-right: 1px solid #eee;
}

.wg-day-col:last-child {
    border-right: none;
}

.wg-cell {
    border-bottom: 1px solid #f0f0f0;
    background: white;
    box-sizing: border-box;
}

/* Restriction block: absolutely positioned inside day column */
.restriction-block {
    position: absolute;
    border-radius: 6px;
    color: white;
    padding: 4px 4px;
    font-size: 0.75em;
    font-weight: 600;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 5;
    box-sizing: border-box;
}

.restriction-block:hover {
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.rb-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.rb-time {
    font-size: 0.85em;
    opacity: 0.85;
    white-space: nowrap;
}

/* Week grid mobile */
@media (max-width: 600px) {
    .week-grid {
        min-width: 320px;
    }

    .wg-corner,
    .wg-hours-col {
        width: 40px;
        min-width: 40px;
    }

    .wg-day-header {
        font-size: 0.75em;
        padding: 8px 2px;
    }

    .wg-hour-label {
        font-size: 0.6em;
        padding: 2px 3px 0 2px;
    }

    .rb-time {
        display: none;
    }
}

/* Focus-visible for keyboard/assistive navigation */
:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Tablet breakpoint */
@media (max-width: 900px) {
    .dashboard-container {
        padding: 20px;
    }

    .booking-card {
        grid-template-columns: 80px 1fr auto;
    }

    .booking-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

/* Touch device styles: remove hover transforms, add active states */
@media (hover: none) {
    button:hover,
    .dashboard-link-btn:hover,
    .copy-btn:hover,
    .logout-btn:hover,
    .month-nav-btn:hover,
    .work-locations-link:hover {
        transform: none;
        box-shadow: none;
    }

    .calendar-day.available:hover {
        background: white;
        color: #333;
        transform: none;
    }

    .calendar-day.has-slots:hover {
        background: #e8f5e9;
        color: inherit;
    }

    .time-slot-btn:hover {
        background: white;
        color: #667eea;
        transform: none;
        box-shadow: none;
    }

    .calendar-day.available:active {
        background: #667eea;
        color: white;
    }

    .calendar-day.has-slots:active {
        background: #4caf50;
        color: white;
    }

    .time-slot-btn:active {
        background: #667eea;
        color: white;
    }

    .visit-type-option:active {
        border-color: #667eea;
        background: #f0f4ff;
    }

    .month-nav-btn:active {
        background: #5a6268;
    }

    .booking-card:active {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .country-option:active {
        background: #e0e7ff;
    }

    .restriction-block:active {
        opacity: 1;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 16px;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 0.95em;
    font-weight: 500;
    color: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease-out;
    max-width: 500px;
    width: calc(100% - 32px);
}

.toast.removing {
    animation: toastSlideOut 0.25s ease-in forwards;
}

.toast-error {
    background: #dc3545;
}

.toast-warning {
    background: #e6a817;
    color: #333;
}

.toast-success {
    background: #28a745;
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.3em;
    cursor: pointer;
    padding: 0 0 0 8px;
    line-height: 1;
    opacity: 0.8;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
    transform: none;
    box-shadow: none;
}

.toast-message {
    flex: 1;
}

@keyframes toastSlideIn {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}
