/* draw.css */

/* Reset and full screen setup */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

main {
    width: 100vw;
    height: 100vh;
    position: relative;
    background-color: white;
}


.back {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    font-size: 10px;
    font-family: "Inter", sans-serif;
    font-weight: 100;
    margin: 0;
}

.back a {
    text-decoration: none;
    position: relative;
    color: black;
}

.back a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0%;
    height: 1px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

.back a:hover::after {
    width: 100%;
}

.back a:hover {
    transform: translateY(-3px);
    color: green;
}

/* Toolbar */
#toolbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background-color: rgba(0, 0, 0);
    border-radius: 30px;
    font-family: "franklin-gothic-atf", sans-serif;
    font-weight: 400;
    font-size: 12px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#toolbar label {
    margin-left: 8px;
}

#toolbar input[type="color"] {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: none;
}

#toolbar input[type="range"] {
    width: 80px;
}

#toolbar button {
    padding: 6px 14px;
    border: none;
    border-radius: 15px;
    background-color: rgba(80, 8, 8, 0.3);
    border: 2px solid rgba(236, 22, 22, 0.3);
    color: white;
    font-family: "franklin-gothic-atf", sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
}

#toolbar button:hover {
    background-color: rgb(236, 22, 22);
    border-color: rgb(236, 22, 22);
}

/* Canvas */
#drawing-board {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    /* cursor: url(../images/brush.png), auto; */
}

/* ======== RESPONSIVE STYLES FOR DRAW PAGE ======== */

/* ——— Tablets (768px - 992px) ——— */
@media (max-width: 992px) {
  .back {
    top: 16px;
    left: 16px;
    font-size: 11px;
  }
  
  #toolbar {
    top: 16px;
    gap: 10px;
    padding: 8px 16px;
    font-size: 11px;
  }
  
  #toolbar input[type="color"] {
    width: 28px;
    height: 28px;
  }
  
  #toolbar input[type="range"] {
    width: 70px;
  }
  
  #toolbar button {
    padding: 5px 12px;
    font-size: 11px;
  }
}

/* ——— Mobile Landscape (481px - 768px) ——— */
@media (max-width: 768px) {
  .back {
    top: 70px;
    left: 12px;
    font-size: 12px;
  }
  
  #toolbar {
    top: 12px;
    gap: 8px;
    padding: 8px 12px;
    font-size: 10px;
    border-radius: 20px;
  }
  
  #toolbar label {
    margin-left: 4px;
  }
  
  #toolbar input[type="color"] {
    width: 26px;
    height: 26px;
  }
  
  #toolbar input[type="range"] {
    width: 60px;
  }
  
  #toolbar button {
    padding: 4px 10px;
    font-size: 10px;
  }
}

/* ——— Mobile Portrait (up to 480px) ——— */
@media (max-width: 480px) {
  .back {
    top: 80px;
    left: 10px;
    font-size: 13px;
    padding: 6px 10px;
  }
  
  #toolbar {
    top: 10px;
    width: calc(100% - 20px);
    max-width: 100%;
    left: 10px;
    transform: none;
    gap: 6px;
    padding: 8px 10px;
    font-size: 9px;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  #toolbar label {
    margin-left: 2px;
    font-size: 9px;
  }
  
  #toolbar input[type="color"] {
    width: 24px;
    height: 24px;
  }
  
  #toolbar input[type="range"] {
    width: 50px;
  }
  
  #toolbar button {
    padding: 4px 8px;
    font-size: 9px;
  }
  
  #drawing-board {
    cursor: default;
  }
}

/* ——— Small Mobile (up to 360px) ——— */
@media (max-width: 360px) {
  .back {
    top: 90px;
    left: 8px;
    font-size: 12px;
  }
  
  #toolbar {
    top: 8px;
    width: calc(100% - 16px);
    left: 8px;
    padding: 6px 8px;
    gap: 4px;
  }
  
  #toolbar label {
    font-size: 8px;
  }
  
  #toolbar input[type="color"] {
    width: 22px;
    height: 22px;
  }
  
  #toolbar input[type="range"] {
    width: 45px;
  }
  
  #toolbar button {
    padding: 3px 6px;
    font-size: 8px;
  }
}

/* ——— Touch Device Optimizations ——— */
@media (hover: none) and (pointer: coarse) {
  .back a:hover {
    transform: none;
    color: black;
  }
  
  .back a::after {
    display: none;
  }
  
  .back {
    padding: 8px 12px;
  }
  
  #toolbar input[type="color"],
  #toolbar button {
    min-width: 32px;
    min-height: 32px;
  }
  
  #drawing-board {
    touch-action: none;
  }
}