/* Basic reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background-color: #8d8d8d; /* slightly darker gray so cards pop */
    color: #e5e7eb;
}

/* ========== AUTH (LOGIN / REGISTER) ========== */

.auth-container {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #111827 0, #020617 55%, #000 100%);
    padding: 16px;
    z-index: 10;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #020617;
    border-radius: 16px;
    padding: 20px 22px 18px;
    border: 1px solid #1f2937;
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.7);
}

.auth-card h1 {
    font-size: 1.7rem;
    margin-bottom: 4px;
}

.auth-subtitle {
    color: #9ca3af;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.auth-tabs {
    display: inline-flex;
    border-radius: 999px;
    background: #020617;
    padding: 3px;
    border: 1px solid #1f2937;
    margin-bottom: 12px;
}

.auth-tab {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 0.9rem;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
}

.auth-tab.active {
    background: #1d4ed8;
    color: #f9fafb;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-form label {
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-form input {
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid #4b5563;             /* clearer box line */
    background: #020617;
    color: #e5e7eb;
}

.auth-form input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
}

.auth-btn {
    margin-top: 12px;
    width: 100%;
    padding: 9px 0;
    border-radius: 999px;
    border: 1px solid #1d4ed8;
    background: #2563eb;
    color: white;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
}

.auth-btn:hover {
    background: #1d4ed8;
}

.auth-note {
    margin-top: 10px;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* ========== MAIN APP ========== */

.app {
    width: 100%;
    max-width: 1400px;          /* wider dashboard */
    margin: 10px auto 24px;
    padding: 12px 20px 24px;
}


/* Header */
header {
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 2px;
}

header p {
    color: #f9fafb;
    font-size: 0.9rem;
}

/* User area in header */
.user-area {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    background: #020617;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #1f2937;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.user-label {
    color: #9ca3af;
}

.user-name {
    font-weight: 600;
}

.logout-btn {
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid #ef4444;
    background: #111827;
    color: #fca5a5;
    font-size: 0.8rem;
    cursor: pointer;
}

.logout-btn:hover {
    background: #7f1d1d;
    color: #fee2e2;
}

/* Sections */

section {
    background: #020816;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
    border: 1px solid #1f2937;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

section h2 {
    margin-bottom: 8px;
    font-size: 1.05rem;
}

/* Clock section */
.clock-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.clock-row label {
    min-width: 160px;
}

.clock-row input[type="time"] {
    padding: 5px 8px;
    border-radius: 8px;
    border: 1px solid #4b5563;
    background: #020617;
    color: #e5e7eb;
}

.clock-row input[type="time"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
}

button {
    padding: 7px 11px;
    border-radius: 8px;
    border: 1px solid #1d4ed8;
    background: #2563eb;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
}

button:hover {
    background: #1d4ed8;
}

.clock-display {
    margin-top: 6px;
    font-size: 0.9rem;
    color: #9ca3af;
}

/* Devices */
.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}


.device-card {
    background: linear-gradient(135deg, #020617, #020b1f);
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid #1f2937;
}

/* Header inside card */
.device-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    column-gap: 8px;
    margin-bottom: 6px;
}

.device-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* enable toggle */
.enable-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #9ca3af;
    flex-shrink: 0;
}

.enable-label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.enable-switch {
    width: 32px;
    height: 16px;
    border-radius: 999px;
    background: #374151;
    position: relative;
    transition: background 0.15s ease;
}

.enable-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #e5e7eb;
    transition: transform 0.15s ease;
}

.enable-checkbox {
    display: none;
}

.enable-checkbox:checked + .enable-switch {
    background: #22c55e;
}

.enable-checkbox:checked + .enable-switch::after {
    transform: translateX(14px);
}

/* Status pill */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.8rem;
    border: 1px solid #4b5563;
    background: #020617;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.status-on {
    background: #22c55e;
    box-shadow: 0 0 6px #22c55e;
}

.status-off {
    background: #ef4444;
    box-shadow: 0 0 6px #ef4444;
}

.status-disabled {
    background: #6b7280;
    box-shadow: 0 0 6px #6b7280;
}

/* Card body */

.device-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.86rem;
    margin-top: 4px;
}

.device-body label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.device-body input[type="time"],
.device-body input[type="text"] {
    flex: 1;
    padding: 4px 7px;
    border-radius: 8px;
    border: 1px solid #4b5563;     /* stronger line */
    background: #020617;
    color: #e5e7eb;
}

.device-body input[type="text"]::placeholder {
    color: #6b7280;
}

.device-body input[type="time"]:focus,
.device-body input[type="text"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
}

.next-change {
    color: #9ca3af;
    font-size: 0.8rem;
    margin-top: 2px;
}

.device-actions {
    margin-top: 4px;
    display: flex;
    justify-content: flex-end;
}

/* SMS area */
.sms-section textarea {
    width: 100%;
    min-height: 120px;
    border-radius: 10px;
    border: 1px solid #4b5563;
    background: #020617;
    color: #e5e7eb;
    padding: 8px;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 0.86rem;
}

.hint {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #9ca3af;
}

footer {
    text-align: center;
    margin-top: 8px;
    color: #111827;
    font-size: 0.8rem;
}

/*ooooooooooooooooooooooooo*/
/* =========================
   Mobile layout fixes
   ========================= */

/* Phones */
@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .app {
    padding: 10px;
  }

  header {
    gap: 10px;
  }

  header h1 {
    font-size: 1.2rem;
    line-height: 1.25;
  }

  header p {
    font-size: 0.95rem;
  }

  /* Make devices stack vertically */
  .devices-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  /* Make inputs/buttons easier to tap */
  .device-body input[type="time"],
  .device-body input[type="text"] {
    font-size: 1rem;
    padding: 10px;
  }

  .save-btn,
  .logout-btn,
  .auth-btn {
    font-size: 1rem;
    padding: 12px 14px;
  }

  /* SMS section (optional): reduce height on phones */
  .sms-section textarea {
    min-height: 120px;
  }
}

/* Small tablets / large phones */
@media (min-width: 601px) and (max-width: 900px) {
  .devices-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px;
  }
}



