/* Reset & base */

/* Prevent any horizontal overflow (blank space) */
html, body {
  overflow-x: hidden;
}

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

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  background-color: var(--bg-color);
  color: var(--text-color);
  padding: 1rem;
  transition: background 0.3s, color 0.3s;
}

:root {
  --bg-color: #f2f2f2;
  --card-bg: #ffffff;
  --text-color: #333;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --btn-bg: #10b981;
  --btn-hover: #059669;
  --input-bg: #fff;
  --input-border: #ccc;
  --selection-bg: #4f46e5;
  --selection-text: #ffffff;
}

body.dark {
  --bg-color: #121212;
  --card-bg: #1e1e1e;
  --text-color: #f0f0f0;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --btn-bg: #14b8a6;
  --btn-hover: #0d9488;
  --input-bg: #333;
  --input-border: #555;
  --selection-bg: #6366f1;
  --selection-text: #ffffff;
}

body.pink {
  --bg-color: #fff0f6;
  --card-bg: #ffe0ec;
  --text-color: #880e4f;
  --accent: #f06292;
  --accent-hover: #ec407a;
  --btn-bg: #f06292;
  --btn-hover: #ec407a;
  --input-bg: #fff5f9;
  --input-border: #f8bbd0;
  --selection-bg: #f06292;
  --selection-text: #fff;
}

body.blue {
  --bg-color: #e3f2fd;
  --card-bg: #bbdefb;
  --text-color: #0d47a1;
  --accent: #2196f3;
  --accent-hover: #1976d2;
  --btn-bg: #42a5f5;
  --btn-hover: #1e88e5;
  --input-bg: #eaf4fe;
  --input-border: #90caf9;
  --selection-bg: #42a5f5;
  --selection-text: #fff;
}

body.high-contrast {
  --bg-color: #000;
  --card-bg: #111;
  --text-color: #fff;
  --accent: #ff0;
  --accent-hover: #ffeb3b;
  --btn-bg: #ff0;
  --btn-hover: #ffeb3b;
  --input-bg: #000;
  --input-border: #fff;
  --selection-bg: #ff0;
  --selection-text: #000;
}

.container {
  max-width: 900px;
  margin: auto;
}

h1, h2 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card {
  background: var(--card-bg);
  color: var(--text-color);
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: background 0.3s, color 0.3s;
}

header.header {
  text-align: center;
  margin-bottom: 2rem;
}


  #themeSelector {
    margin-left: 20px;
    background: rgba(255,255,255,0.85);
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 1rem;
    cursor: pointer;
    min-width: 140px;
    color: #222;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: background 0.3s ease;
  }
  #themeSelector:hover,
  #themeSelector:focus {
    background: #fff;
    outline: none;
  }

button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

button:hover {
  background: var(--accent-hover);
}

input[type="text"] {
  padding: 0.5rem;
  width: calc(100% - 140px);
  max-width: 300px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  margin-right: 0.5rem;
  color: var(--text-color);
}

a.btn {
  display: inline-block;
  margin-top: 0.5rem;
  background: var(--btn-bg);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.3s;
}

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

footer {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.875rem;
  color: #777;
}

#searchInput {
  width: 100%;
  max-width: 500px;
  margin: 2rem auto;
  display: block;
  padding: 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  font-size: 1rem;
  background: var(--input-bg);
  color: var(--text-color);
}

@media (max-width: 768px) {
  .card {
    padding: 1rem;
  }
  h1 {
    font-size: 1.75rem;
  }
  h2 {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  input[type="text"], button {
    width: 100%;
    margin-bottom: 1rem;
  }
}

.reveal-btn {
  margin-top: 0.5rem;
  background: #f59e0b;
}

.reveal-btn:hover {
  background: #d97706;
}

.keyword-block {
  background: var(--card-bg);
  border: 1px solid var(--input-border);
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  transition: background 0.3s, color 0.3s;
}

.keyword-block h3 {
  margin-bottom: 0.5rem;
}

.api-result h4 {
  margin-top: 0.75rem;
  font-weight: 600;
}

.card {
  animation: fadeInUp 0.5s ease-in-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: #555; }

/* Load Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Poppins:wght@500;700&display=swap');

 /* CLOCK CONTAINER */
  #digital-clock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: auto;
    padding: 8px 12px;
    background: #222;
    border: 2px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    margin: 0 auto;                /* center horizontally */
    font-family: 'Courier New', monospace;
    color: #eee;
    font-weight: bold;
    font-size: 1.3rem;
    /* pulse animation on border */
    animation: pulse-border 1s ease-out infinite;
  }

  /* TIME PARTS */
  #hour, #minute, #second { width: 1.2em; text-align: right; }
  #ampm {
    margin-left: 6px;
    font-size: 0.8rem;
    color: #aaa;
    user-select: none;
  }

  /* BLINKING COLON */
  .colon {
    animation: blink-colon 1s step-end infinite;
  }

  /* PULSE BORDER KEYFRAMES */
  @keyframes pulse-border {
    0%   { box-shadow: 0 0 0 #ccc; }
    50%  { box-shadow: 0 0 8px #ccc; }
    100% { box-shadow: 0 0 0 #ccc; }
  }

  /* BLINK COLON KEYFRAMES */
  @keyframes blink-colon {
    0%, 49%   { opacity: 1; }
    50%, 100% { opacity: 0; }
  }

  /* SMALL-SCREEN ADJUSTMENTS */
  @media (max-width: 400px) {
    #digital-clock {
      font-size: 1rem;
      padding: 6px 8px;
    }
    #ampm {
      font-size: 0.7rem;
    }
  }


  #digital-clock-container {
  text-align: center;
  padding: 1rem;
  color: #eee;
  font-family: 'Segoe UI', sans-serif;
  border-bottom: 2px solid #181818;
 
}

#digital-clock {
  font-size: 2.2rem;
  font-weight: bold;
  letter-spacing: 1.5px;
 
}

#clock-label {
  margin-top: 0.4rem;
  font-size: 1rem;
  color: #0e0d0d;
  font-style: italic;
  
}

@media (max-width: 600px) {
  #digital-clock {
    font-size: 1.5rem;
  }

  #clock-label {
    font-size: 0.85rem;
  }
}
