/* Reset & Body */
body, html {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", "Inter", sans-serif;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #e0e7ff, #f0f4f8);
  color: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  transition: background 0.5s ease;
}

/* App Container */
.app-container {
  display: grid;
  grid-template-columns: 280px 1fr 300px;
  width: 95%;
  height: 95%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(15px) saturate(180%);
  transition: all 0.3s ease;
}

/* Left Toolbar */
.toolbar-left {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px) saturate(180%);
  border-right: 1px solid rgba(255,255,255,0.3);
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 25px;
  overflow-y: auto;
  align-items: center;
  border-radius: 16px 0 0 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.toolbar-left h1 {
  text-align: center;
  font-size: 30px;
  color: #6c63ff;
  margin-bottom: 15px;
  text-shadow: 0 2px 6px rgba(108,99,255,0.3);
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
}

/* Upload Sections */
.upload-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 8px;
  border-radius: 12px;
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  background: rgba(255,255,255,0.2);
}
.upload-section:hover {
  transform: translateY(-5px) scale(1.03);
  background: rgba(160,196,255,0.2);
  box-shadow: 0 8px 20px rgba(108,99,255,0.2);
}
.upload-section label {
  font-size: 28px;
  color: #6c63ff;
  transition: color 0.3s ease;
}
.upload-section label:hover {
  color: #9f7aff;
}
.upload-section span {
  font-weight: 600;
  color: #555;
}
.upload-section input[type="file"] {
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  width: 100%;
  transition: 0.3s;
}
.upload-section input[type="file"]:hover {
  background: #e0e7ff;
}

/* Sliders */
.sliders {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}
.control-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.control-group label {
  font-size: 22px;
  color: #6c63ff;
}
.control-group span {
  font-weight: 600;
  color: #555;
}
.control-group input[type="range"] {
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg,#6c63ff,#9f7aff);
  width: 100%;
  transition: all 0.3s ease;
}
.control-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ff7a95;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255,122,149,0.6);
  transition: all 0.3s ease;
}
.control-group input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 12px rgba(255,122,149,0.8);
}

/* Buttons Grid */
.buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}
.buttons button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  background: linear-gradient(135deg,#6c63ff,#9f7aff);
  color: #fff;
  cursor: pointer;
  transition: all 0.4s ease;
  text-align: center;
  box-shadow: 0 6px 15px rgba(108,99,255,0.35);
}
.buttons button i {
  font-size: 20px;
}
.buttons button span {
  font-size: 12px;
}
.buttons button:hover:not(:disabled) {
  transform: translateY(-5px) scale(1.05);
  background: linear-gradient(135deg,#9f7aff,#6c63ff);
  box-shadow: 0 10px 25px rgba(108,99,255,0.45);
}
.buttons button:disabled {
  background: rgba(200,200,200,0.4);
  color: #777;
  cursor: not-allowed;
}

/* Canvas */
.editor-main {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #edf0f9;
}
.canvas-wrapper {
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  border: 2px dashed rgba(108,99,255,0.3);
  box-shadow: 0 10px 30px rgba(108,99,255,0.1);
  transition: all 0.3s ease;
}
.canvas-wrapper:hover {
  border-color: #6c63ff;
  box-shadow: 0 15px 40px rgba(108,99,255,0.25);
}
#canvas {
  max-width: 100%;
  max-height: 100%;
}

/* Placeholder */
#placeholderText {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  color: #666;
  font-size: 18px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0.9;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#placeholderText::before {
  content: "\f093";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 50px;
  color: #6c63ff;
  animation: float 1.5s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translate(-50%,-50%) translateY(0); }
  50% { transform: translate(-50%,-50%) translateY(-8px); }
}

/* Right Panel */
.editor-right {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px) saturate(180%);
  border-left: 1px solid rgba(255,255,255,0.3);
  padding: 20px;
  border-radius: 0 16px 16px 0;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.editor-right h3 {
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #6c63ff;
}
#clear-history { cursor:pointer; color:#6c63ff; }
#historyList {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.history-item {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid #ccc;
  overflow: hidden;
  transition: transform 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}
.history-item:hover {
  border: 2px solid #6c63ff;
  transform: scale(1.15);
  box-shadow: 0 6px 15px rgba(108,99,255,0.35);
}

/* Spinner */
.spinner-center {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -30px;
  margin-left: -30px;
  width: 60px;
  height: 60px;
  border: 6px solid rgba(0,0,0,0.1);
  border-top-color: #6c63ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
  z-index: 2000;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Cursor */
.canvas-brush, .canvas-eraser {
  cursor: none;
}
