/* ──────────────────────────────────────────────────────────────────────────
   1) GLOBAL / BASE STYLES
   ────────────────────────────────────────────────────────────────────────── */

/* Box‐sizing reset */
html {
    box-sizing: border-box;
    font-size: 16px;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

/* Body */
body {
    margin: 0;
    padding: 1rem;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Container */
.container {
    width: 90%;
    max-width: 800px;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 2rem auto;
}

/* Headings */
h1 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Labels & Inputs */
label {
    display: block;
    margin-top: 1rem;
    font-weight: 500;
    color: #1c1c1e;
    font-size: 0.95rem;
}

input {
    padding: 0.5rem;
    font-size: 1rem;
    width: 100%;
    margin-top: 0.25rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #1c1c1e;
}

input::placeholder {
    color: #8e8e93;
}

/* Buttons (base, full opacity by default) */
button {
    margin-top: 1rem;
    padding: 0.6rem;
    font-size: 1rem;
    width: 100%;
    background-color: #007AFF;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    opacity: 1;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

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

.hidden-file-input {
    display: none !important;
}

/* ──────────────────────────────────────────────────────────────────────────
   2) HOME-PAGE SPECIFIC STYLES
   ────────────────────────────────────────────────────────────────────────── */

/* Section spacing */
.section {
    margin-bottom: 2rem;
}

.section label {
    margin-bottom: 0.5rem;
}

/* Info field */
.info-field {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* Edit / Save / Cancel buttons */
.edit-btn {
    background: #007aff;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.edit-btn:disabled {
    background: #aaa;
}

.sign-out {
    background: #dc3545;
}

.save-btn {
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    margin-top: 1rem;
}

.save-btn:disabled {
    background: #aaa;
}

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

/* Toggle Open/Closed */
.toggle-btn {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #fff;
    margin-top: 0.5rem;
}

.toggle-open {
    background-color: #28a745;
}

.toggle-closed {
    background-color: #dc3545;
}

/* Service tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

table th,
table td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: center;
}

table th {
    background: #f0f0f0;
    font-weight: 600;
}

/* Add/Remove row buttons */
.service-section {
    margin-top: 1rem;
}

.add-row-btn {
    margin-top: 0.5rem;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.remove-row-btn {
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    font-size: 0.8rem;
}

/* Submit services button */
.submit-btn {
    margin-top: 2rem;
    background: #007aff;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    display: block;
    width: 100%;
}

.submit-btn:disabled {
    background: #aaa;
}

/* Input fields inside tables */
input.table-input {
    width: 80%;
    padding: 0.2rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}

/* Image preview grid */
.image-grid {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.image-grid img,
#existing-images img {
    max-width: 120px;
    max-height: 80px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    object-fit: cover;
}

/* ──────────────────────────────────────────────────────────────────────────
   3) AUTH-PAGE (LOGIN & SIGN-UP) STYLES
   ────────────────────────────────────────────────────────────────────────── */

/* Auth container (narrower on large screens) */
.auth-container {
    max-width: 400px;
}

.auth-container h1 {
    color: #1c1c1e;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.auth-container p {
    margin-bottom: 1rem;
    text-align: center;
    color: #555;
    font-size: 0.95rem;
}

.auth-container input {
    padding: 0.6rem;
}

/* Sign-Up button variation */
.signup-button {
    background-color: #34C759;
    /* it will automatically be 100% opaque unless disabled */
}

/* reCAPTCHA container */
#recaptcha-container {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

/* Status messages */
.status-success {
    color: green;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.status-error {
    color: red;
    margin-top: 1rem;
    font-size: 0.95rem;
}

/* Server response block */
pre {
    background: #f4f4f4;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre-wrap;
    margin-top: 1rem;
    font-family: monospace;
    font-size: 0.9rem;
    color: #333;
}

/* ──────────────────────────────────────────────────────────────────────────
   4) MEDIA QUERIES FOR RESPONSIVENESS
   ────────────────────────────────────────────────────────────────────────── */

/* Mobile phones (up to 600px) */
@media (max-width: 600px) {
    html {
        font-size: 14px;
    }

    body {
        padding: 0.5rem;
    }

    .container {
        margin: 1rem auto;
        padding: 1rem;
    }

    .auth-container {
        margin-top: 2rem;
        padding: 1rem;
    }

    input,
    button {
        font-size: 1.1rem;
    }
}

/* Tablets (601px – 1024px) */
@media (min-width: 601px) and (max-width: 1024px) {
    html {
        font-size: 15px;
    }

    .container {
        margin: 1.5rem auto;
        padding: 1.5rem;
    }

    .auth-container {
        margin-top: 2rem;
        padding: 1.5rem;
    }
}

/* Large desktops (1025px – 1920px) */
@media (min-width: 1025px) and (max-width: 1920px) {
    html {
        font-size: 16px;
    }

    .container {
        margin: 2rem auto;
        padding: 2rem;
    }

    .auth-container {
        margin-top: 2rem;
        padding: 2rem;
    }
}

/* Ultra-wide screens (1921px and up) */
@media (min-width: 1921px) {
    html {
        font-size: 18px;
    }

    .container {
        width: 70%;
        max-width: 1200px;
        margin: 3rem auto;
        padding: 2.5rem;
    }

    .auth-container {
        width: 50%;
        max-width: 600px;
        margin: 3rem auto;
        padding: 2.5rem;
    }
}

.qr-container {
    margin: 1.5rem 0;
    text-align: center;
}

.qr-container img {
    max-width: 180px;
    height: auto;
    border: 1px solid #ccc;
    padding: 0.5rem;
    background: #fff;
    border-radius: 8px;
}

.qr-container p {
    margin-bottom: 0.5rem;
    font-weight: 500;
}
/*────────────────────────────────────────────────────────
  Chat Bubble (FAB)
────────────────────────────────────────────────────────*/
button.chat-bubble-fab {
    all: unset;
    /* kill your global button rules */
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    width: 48px !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    background-color: #007aff !important;
    color: #fff !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
    font-size: 24px !important;
    cursor: pointer !important;
    z-index: 1000 !important;
    transition: transform 0.1s !important;
}

button.chat-bubble-fab:hover {
    transform: scale(1.1) !important;
}

/*────────────────────────────────────────────────────────
  Chat Window Container
────────────────────────────────────────────────────────*/
.chat-window {
    position: fixed;
    bottom: 80px;
    /* sits above the FAB */
    right: 20px;
    width: 300px;
    height: 350px;
    /* fixed height so inner scroll works */
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* clip children */
    z-index: 1000;
}

/* Header */
.chat-header {
    background: #f2f2f7;
    padding: 8px 12px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-close {
    all: unset;
    /* nuke global button rules */
    cursor: pointer;
    font-size: 18px;
    color: #666;
}

/* Messages area */
.chat-messages {
    flex: 1;
    /* take all remaining space */
    padding: 8px;
    overflow-y: auto;
    /* scroll inside here */
    font-size: 14px;
}

/* Individual bubbles */
.chat-message {
    margin: 6px 0;
    line-height: 1.4;
}

.chat-message.user {
    text-align: right;
    color: #007aff;
}

.chat-message.bot {
    text-align: left;
    color: #333;
}

/* Input bar */
.chat-input-area {
    display: flex;
    border-top: 1px solid #e0e0e0;
    padding: 6px;
}

.chat-input-area input {
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 14px;
    margin-right: 6px;
}

.chat-input-area button {
    all: unset;
    /* kill global button rules */
    background: #007aff;
    color: #fff;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
}
.app-login-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background-color: #0047BB;
  color: white;
  font-weight: bold;
  text-align: center;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.app-login-btn:hover {
  background-color: #003399;
}

/* Cupertino-style button */
.cupertino-btn {
    background-color: #007AFF;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cupertino-btn:hover {
    background-color: #0051A8;
}

/* Card container for schedule form */
.cupertino-card {
    background-color: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Inputs styled like iOS text fields */
.cupertino-input {
    border: 1px solid #CCCCCC;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 16px;
    height: 40px;
    box-sizing: border-box;
}

/* Schedule form spacing */
.schedule-form {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
}

.schedule-form h2 {
    margin-bottom: 12px;
    color: #333333;
}

.schedule-form .day-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.schedule-form .day-row label {
    width: 25%;
    font-size: 16px;
    color: #444444;
}

.schedule-form .day-row input {
    width: 35%;
}

/* Utility spacing */
.mt-4 {
    margin-top: 1rem;
}

.p-4 {
    padding: 1rem;
}

.rounded-2xl {
    border-radius: 16px;
}

.shadow-md {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.w-full {
    width: 100%;
}

.text-xl {
    font-size: 1.25rem;
}

.font-medium {
    font-weight: 500;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* Dashboard container */
.dashboard {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px;
    background-color: #F2F2F7;
    /* iOS grouped background */
    margin: 0 auto;
    max-width: 800px;
}

/* Individual cards */
.dashboard-card {
    flex: 1 1 calc(33.333% - 16px);
    min-width: 140px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    /* frosted-glass effect */
    border-radius: 16px;
    /* cupertino corner radius */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    padding: 16px;
    text-align: center;
    transition: transform 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

/* Card titles */
.card-title {
    font-family: -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 16px;
    font-weight: 600;
    /* semibold iOS style */
    color: #1C1C1E;
    /* iOS primary label */
    margin-bottom: 8px;
}

/* Card numbers */
.card-number {
    font-family: -apple-system, BlinkMacSystemFont, "San Francisco", sans-serif;
    font-size: 28px;
    font-weight: 700;
    /* heavy for emphasis */
    color: #007AFF;
    /* iOS system blue */
    line-height: 1;
}