/* 
 * styles.css — Version 0.4 by @batrasanchit
 * This file contains all styles used for the multi-tool clock web app,
 * including layouts for clock, stopwatch, timer, settings modal,
 * background effects, FAB interactions, and share features.
*/

/* ========== Base Global Styles ========== */
html, body {
  height: 100%;
  margin: 0;
  background: black;
  color: white;
  font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow:hidden;
}

/* ========== Layout Container for the App ========== */
.layout {
  position: absolute;   /* instead of relative */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ========== Header Bar ========== */
.app-header {
  height: 10%;
  width: 100%;
  display: inline-flex;
  flex-direction: row;
  flex-shrink: 0;
  justify-content: flex-start; /* push buttons to edges */
  align-items: center;            /* vertically center icons */
  padding: 0 20px;
  background: #222;
  color: white;
}

.header-btn {
  background: transparent;
  border: none;
  font-size: 50vh;
  color: white;
  cursor: pointer;
  width: 10vb;
  margin-left: 0vb;
  margin-right: 5vb;
  height: 7vb;
  z-index: 1000;
}

/* ========== Main Clock Container ========== */
#main-container {
    position: relative;
    height: 90%;
    top: 10%;
    align-items: center;
    justify-content: space-evenly;
    display: flex;
    align-content: center;
    flex-direction: column-reverse;
    flex-wrap: wrap;
    /* z-index: 5; */
}


#clock {
  border: none;
  padding: 20px;
  font-size: 10vw;
  font-family: 'digital-clock-font';
}

/* ========== Settings Toggle Button ========== */
.settings-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  width: 10vb
}

/* ========== Settings Modal ========== */
#settings-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1010;

}

#settings-overlay.hidden {
  display: none;
}

#settings-modal {
  position: relative;
  background: #fefefe;
  color: #222;
  padding: 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#settings-modal h2 {
  margin-top: 0;
}

section.active {
  display: block;
}

/* ========== Form Element Styling ========== */
select, input[type="number"], button{
  width: 100%;
    max-width: 300px;
    margin-top: 10px;
    margin-bottom: 10px;
    /* padding: 10px; */
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: black solid 1px;
    cursor: pointer;
}

input[type="file"]{
  width: 100%;
  max-width: 300px;
  margin: 10px auto;
  padding: 10px;
  font-size: 16px;
  display: block;
  border-radius: 6px;
}

/* ========== Floating Audio Button Container ========== */
.audio-fab-container {
  position: fixed;
  bottom: 20px;
  right: 0px;
}

.audio-fab-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

/* ========== FAB Main Button and Option Expansions ========== */
.fab-main {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #0cf;
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

.fab-options {
  position: absolute;
  bottom: 0;
  right: -20;
  width: 160px;
  height: 160px;
  pointer-events: none;
}

.fab-btn {
  position: absolute;
  overflow: hidden;
  bottom: 0;
  left: 0;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: white;
  border: none;
  cursor: pointer;
  opacity: 0;
  transform: translate(0, 0);
  pointer-events: none;
  text-align: center;
  font-size: small;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.fab-btn::before{
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background-color: limegreen;
  opacity: 0.5;
  z-index: 0;
  transition: height 0.1s ease;
  pointer-events: none;
}


.fab-btn span {
  position: relative;
  z-index: 1;
}

.fab-options.show .fab-btn {
  opacity: 1;
  pointer-events: auto;
}

/* ========== Side Navigation Drawer ========== */
.drawer {
  position: fixed;
  display: none;
  top: 0;
  width: 250px;
  height: 100%;
  background: #ffffff;
  color: transparent;
  transition: left 0.3s ease;
  z-index: 1000;
  box-shadow: 2px 0 10px rgba(0,0,0,0.3);
}

.drawer.open {
  display:flex
}

.drawer-content {
  padding: 20px;
}

.drawer-btn {
  display: block;
  width: 100%;
  padding: 12px 20px;
  margin: 8px 0;
  background-color: #ffffff;
  color: white;
  /* border: #555555 5px solid; */
  border-radius: 6px;
  font-size: 16;
  text-align: left;
  color: #000000;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.drawer-btn:hover {
  background-color: #3e5871;
  transform: translateX(4px);
}

.drawer-btn:active {
  background-color: #2c3e50;
  transform: translateX(2px);
}
.spacer{
    flex-grow: 1;
}

/* ========== Custom Digital Clock Font ========== */
@font-face{
 font-family:'digital-clock-font';
 src: url('./assets/fonts/clockfont1.ttf') format('truetype');
}

/* ========== Modal Close Button ========== */
.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;

  /* appearance */
  background: none;
  border: none;
  color: rgb(255, 0, 0);
  font-size: 36px;

  /* layout */
  padding-right: 5%;
  width: auto;
  height: auto;
  line-height: 1;

  /* behavior */
  cursor: pointer;
  z-index: 1011;
}

/* ========== Stopwatch Section ========== */
#stopwatch-container{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 15;
    background-color: rgb(0, 0, 0, 0.4);
    border: none;
    padding: 20px;
    backdrop-filter: blur(6px);
    border-radius: 16px;
}

#stopwatch-controls {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

#stopwatch-container button:hover {
  background: #0cf;
}

#stopwatch-controls button {
  padding: 10px 20px;
  font-size: 16px;
  font-weight: bold;
  background: #ffffff;
  color: black;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

#stopwatch{
    font-size: 10vw;
    font-family: 'digital-clock-font';
    margin-bottom: 20px;
}

/* ========== Timer Section ========== */
#timer-container {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
}

.timer-box {
  border: none;
  border-radius: 16px;
  background-color: rgba(0, 0, 0, 0.4);
  /* box-shadow: 0 0 20px #0cf5; */
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: blur(6px);
  /* width: 90%; */
}

#segmented-time {
  display: flex;
  align-items: center;
  font-size: 6vw;
  margin-bottom: 20px;
  gap: 10px;
}

#segmented-time input[type="number"] {
  font-size: 10vw;
  text-align: center;
  border-bottom: 1px solid white;
  background: transparent;
  color: white;
  font-family: 'digital-clock-font';
  appearance: textfield;
}

#segmented-time input[type="number"]:focus {
  outline: none;
  border-bottom: 3px solid lightblue
}

#segmented-time input::-webkit-inner-spin-button,
#segmented-time input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#segmented-time span {
  font-size: 6vw;
  color: white;
  user-select: none;
}

.timer-controls {
  display: flex;
  gap: 1vw;
}

.timer-controls button {
  padding: 1.5vw 3vw;
  font-size: 2vw;
  font-weight: bold;
  background: #ffffff;
  color: black;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.timer-controls button:active {
  background: #0cf;
}

/* ========== Physics Background Canvas ========== */
#bg-physics {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 90%;
  z-index: 11;
  pointer-events: painted;
}
#rockDensity {
  width: 100%;
  max-width: 300px;
  margin-top: 10px;
}

/* ========== About Section ========== */
#about-container {
  display: flex;
  flex-direction: column;
  justify-items: center;
  bottom: 0;
  height: 90vh;
}

#stopwatch-settings {
  display: flex !important;
  flex-direction: column;
  padding: 10px;
}

#about-box {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #ddd;
  max-width: 800px;
  margin: 20px auto;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  /* background-color: #f9f9f9; */
  backdrop-filter: blur(5px);
  z-index: 25;
  overflow-y: scroll;
  scrollbar-width: none;
}

/* ========== Social Share Button Styles ========== */
.share-buttons {
  position: absolute;
  bottom: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: left;
}

.share-btn {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: none;
  color: white;
  font-size: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s;
  cursor: pointer;
}

.share-btn[data-platform="fb"]       { background: #3b5998; }
.share-btn[data-platform="whatsapp"]{ background: #25D366; }
.share-btn[data-platform="x"]       { background: #000000; }
.share-btn[data-platform="reddit"]  { background: #FF4500; }
.share-btn[data-platform="pinterest"] { background: #BD081C; }
.share-btn[data-platform="linkedin"] { background: #0077b5; }
.share-btn[data-platform="copy"]    { background: #555; }

.share-btn[data-platform="fb"]:hover       { color: #3b5998; }
.share-btn[data-platform="whatsapp"]:hover{ color: #25D366; }
.share-btn[data-platform="x"]:hover       { color: #000000; }
.share-btn[data-platform="reddit"]:hover  { color: #FF4500; }
.share-btn[data-platform="pinterest"]:hover { color: #BD081C; }
.share-btn[data-platform="linkedin"]:hover { color: #0077b5; }
.share-btn[data-platform="copy"]:hover    { color: #555; }

.share-btn[data-platform]:hover {
  background: white;
  border: 2px solid currentColor;
}

/* ========== Toast Notification Styles ========== */
.toast {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: #323232;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
}

.toast.hidden {
  display: none;
}

/* ========== Pattern Background Styles ========== */
/* Existing styles remain unchanged above */

/* 🌸 Nature Inspired Emoji Patterns */
body.pattern-flowers::before,
body.pattern-leaves::before,
body.pattern-clouds::before {
  content: '';
  font-size: 40px;
  white-space: pre;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  align-content: space-around;
  opacity: 0.2;
  z-index: -1;
  pointer-events: none;
}

body.pattern-flowers {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='50' height='50'><text x='50%' y='50%' font-size='32' dominant-baseline='middle' text-anchor='middle'>🌸</text></svg>");
  background-size: 50px 50px;
  background-repeat: repeat;
  background-color: #fff0f5;
}
body.pattern-leaves {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='50' height='50'><text x='50%' y='50%' font-size='30' dominant-baseline='middle' text-anchor='middle'>🍃</text></svg>");
  background-size: 50px 50px;
  background-repeat: repeat;
  background-color: #f0fff0;
}
body.pattern-clouds {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60'><text x='50%' y='50%' font-size='28' dominant-baseline='middle' text-anchor='middle'>☁️</text></svg>");
  background-size: 60px 60px;
  background-repeat: repeat;
  background-color: #e0f7fa;
}

/* 🔲 Geometric Patterns (CSS Based) */
body.pattern-gingham {
  background-color: white;
  background-image:
    linear-gradient(to right, rgba(255, 182, 193, 0.3) 50%, transparent 50%),
    linear-gradient(to bottom, rgba(255, 182, 193, 0.3) 50%, transparent 50%),
    linear-gradient(to right, rgba(255, 182, 193, 0.6) 50%, transparent 50%),
    linear-gradient(to bottom, rgba(255, 182, 193, 0.6) 50%, transparent 50%);
  background-size: 40px 40px;
  background-position:
    0 0,
    0 0,
    20px 20px,
    20px 20px;
}

body.pattern-stripes {
  background-image: repeating-linear-gradient(
    45deg,
    #fcb69f,
    #fcb69f 10px,
    #ffecd2 10px,
    #ffecd2 20px
  );
  background-repeat: repeat;
  background-color: #fff5f0;
  background-size: auto; /* or remove this line entirely */
}

body.pattern-dots {
  background-image: radial-gradient(#ff69b4 3px, transparent 3px);
  background-size: 30px 30px;
  background-color: #fff0f5;
}

body.pattern-grids {
  background-image: linear-gradient(#ccc 1px, transparent 1px), linear-gradient(90deg, #ccc 1px, transparent 1px);
  background-size: 40px 40px;
}

body.pattern-gradient {
  background-image: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

body.pattern-none {
  background-image: none;
}