/* --- Theme Variables --- */
:root {
  --bg-color: #f4f6fb;
  --text-color: #333;
  --column-bg: #e3e7ef;
  --card-bg: #fdfeff;
  --header-color: #1c053c;
  --accent-color: #2f056b;
  --border-color: rgba(0,0,0,0.1);
  --progress-bg: #d1d8e0;
  --primary-btn-color: #200346;
  --collapse-btn-bg: #ffffff4f;
  --popup-info-text-color:var(--text-color);
  --popup-info-text-bg-color:#cbe3f3;
  --row-hover-bg: #e4e4f3;
  --fc-border-color:#dcdfe3;
  --table-row-head: #cccccc;
}

body.dark-mode {
  --bg-color: #1a1a2e;
  --text-color: #e0e0e0;
  --column-bg: #16213e;
  --card-bg: #0f3460;
  --header-color: #4ecca3;
  --accent-color: #5f62ff;
  --border-color: rgba(255,255,255,0.1);
  --progress-bg: #2d3436;
  --primary-btn-color: #8280d9;
  --collapse-btn-bg:rgba(255,255,255,0.1);
  --popup-info-text-color:var(--text-color);
  --popup-info-text-bg-color:#03172e;
  --row-hover-bg: #052750;
  --fc-border-color:#3b516a;
  --table-row-head: #222222;
}

.logoimg {
  height: 1.4em;
  vertical-align: middle;
  padding: .1em; 
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  flex-wrap: wrap;
}

.card-sub-footer{  display: flex;   flex-direction: row;   flex-wrap: nowrap;  justify-content: space-between;   align-items: baseline; width: stretch;}
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { 
  background: var(--popup-info-text-bg-color); color:  var(--popup-info-text-color); font-size: 11px; 
  padding: 1px 6px; border-radius: 6px; display: flex; align-items: center; gap: 3px; 
}

.tag-remove { cursor: pointer; font-weight: bold; opacity: 0.7; font-size: large;}
.tag-remove:hover { opacity: 1; }

.tag-input-container { position: relative; flex: 1; min-width: 60px; }
.tag-input { 
  width: 100%; font-size: 11px; padding: 2px 4px; border: 1px dashed var(--border-color); 
  background: transparent; color: var(--text-color); border-radius: 4px; outline: none;
}

.tag-dropdown {
  position: absolute; bottom: 100%; left: 0; width: 140px; background: var(--card-bg);
  border: 1px solid var(--accent-color); z-index: 1000; border-radius: 4px;
  max-height: 100px; overflow-y: auto; display: none;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.2); margin-bottom: 5px;
}
.tag-suggestion { padding: 4px 8px; cursor: pointer; font-size: 11px; border-bottom: 1px solid var(--border-color); }
.tag-suggestion:hover { background: var(--accent-color); color: white; }

.dialog-info{
    background-color:var(--popup-info-text-bg-color);
    padding: 8px; 
    color: var(--popup-info-text-color);
    border-radius: 2px;
    text-wrap-style: pretty;
}

* { margin:0; padding:0; box-sizing:border-box; font-family: "Afacad Flux", sans-serif; transition: background 0.3s, color 0.2s; }
body { background: var(--bg-color); color: var(--text-color); padding: 20px; overflow: hidden; }

header { position: relative; }
.sub-header { display: flex; justify-content: center; align-items: center; gap: 15px; margin-bottom: 12px; max-width: 900px; margin-left: auto; margin-right: auto; position: relative;  }

h1 { display: flex; justify-content: space-between; align-items: center; color: var(--header-color); }
.btn-ui {user-select: none; border: none; padding: 8px 15px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 16px; transition: all 0.2s; }
.btn-icon { background: transparent; border: none; font-size: 20px; cursor: pointer; opacity: 0.7; }
.btn-icon:hover { opacity: 1; transform: scale(1.1); }
.btn-restore { background: var(--accent-color); color: white; border: none; padding: 8px 12px; border-radius: 4px; cursor: pointer; }
.btn-restore:hover {background: cadetblue;}
.btn-sm{ max-width: 6em;}
.btn-mid{max-width: 9em;}
.btn-wide{max-width: 12em;}
.uibtnicon{ vertical-align: sub; height: 1.2em; color: var(--primary-btn-color);}
.progress-container { margin-top: 6px; width: 100%; background: var(--progress-bg); height: 6px; border-radius: 4px; overflow: hidden; }
#progress-fill { height: 100%; background: #2ecc71; width: 0%; transition: width 0.5s ease; }

.board { 
  position: relative; width: 100vw; height: calc(100vh - 22vh); overflow: auto; padding: 25px;
  background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
  background-size: 25px 25px;
  scrollbar-color: #200346  #f4f6fb11
}

.column {
  position: absolute;
  background: linear-gradient(135deg, #dfddd085 0%, #c7e1e14d 100%); 
  padding: 15px; border-radius: 12px; width: 280px; max-height: 550px; 
  display: flex; flex-direction: column; 
  box-shadow: 0 10px 30px rgba(0,0,0,0.1); border: 1px solid rgba(47, 5, 107, 0.05);
  backdrop-filter: blur(5px);
  transition: top 0.4s ease, left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), height 0.3s ease;
  cursor: grab;
}

.txt{
  color: var(--text-color);
}

.column.dragging { transition: none !important; z-index: 2000 !important; opacity: 0.9; cursor: grabbing; }

.column-header { 
  display: flex; justify-content: space-between; align-items: center; 
  margin-bottom: 15px; border-bottom: 1px solid var(--border-color); padding-bottom: 8px;
  pointer-events: none;
}
.column-header h3, .column-header .collapse-btn { pointer-events: auto; user-select: none; }

.collapse-btn:hover{  background: rgb(171, 171, 179);}
.sharedeck-btn:hover{  background: rgb(171, 171, 179);}

.column h3 { font-size: 1.1em; flex: 1; user-select: none;  }

.column-body { flex: 1; overflow-y: auto; transition: scrollbar-color 0.3s ease; padding-right: 4px; scrollbar-width: none; min-height: 50px; padding-top: 5px; scrollbar-color: #764baf36 #e1e5e500;}

.column:hover .column-body,
.column:focus-within .column-body {
  overflow-y: auto;
  scrollbar-width: thin;  
  scrollbar-color: var(--accent-color) transparent;
}

.column-body::-webkit-scrollbar {
  width: 6px;
}

.column-body::-webkit-scrollbar-thumb {
  background: transparent;  
  border-radius: 10px;
  transition: background 0.4s ease;  
}

.column:hover .column-body::-webkit-scrollbar-thumb,
.column:focus-within .column-body::-webkit-scrollbar-thumb {
  background: var(--accent-color);  
}

.column-body::-webkit-scrollbar-track {
  background: transparent;
}

.column:hover .column-body::-webkit-scrollbar,
.column:focus-within .column-body::-webkit-scrollbar {
  display: block;
}

.column-body::-webkit-scrollbar-thumb {
  border-radius: 10px;
}

.sharedeck-btn {
  background: var(--collapse-btn-bg); border:none;
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 12px;opacity: 0.9;
  
}

.collapse-btn {
  background: var(--collapse-btn-bg); border: none;
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 12px;opacity: 0.9;
}
.column.collapsed { height: 60px; }
.column.collapsed .collapse-btn { transform: rotate(-90deg); }
.column.collapsed .column-body { display: none; }

.column-close-btn {
  background: transparent;
  border: none;
  color: var(--text-color);
  font-size: 12px;
  cursor: pointer;
  opacity: 0.5;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.column-close-btn:hover {
  opacity: 1;
  color: #e74c3c;  
  scale: 1.5;
}

.column-controls {
  display: flex;
  align-items: center;
  pointer-events: auto;
  user-select: none; 
  gap: 0.9em;
}

.card {
  background: var(--card-bg); padding: 12px; border-radius: 8px; margin-bottom: 12px;
  cursor: grab; display: flex; flex-direction: column; gap: 4px;
  box-shadow: 0 3px 10px var(--border-color);
  position: relative; z-index: 10;
}
.card:focus-within { z-index: 100; } /* Lift card on focus */
.card.dragging-card { opacity: 0.3; border: 2px dashed var(--accent-color); }

.card-top { display: flex; align-items: center; gap: 8px; pointer-events: none; }
.card-top span, .card-top button { pointer-events: auto; }
.card-top span { flex: 1; font-weight: 600; }
.card-desc { font-size: 0.9em; opacity: 0.7; font-style: italic; white-space: pre-wrap; cursor: text; min-height: 1em; }
.start-date, .card-date { font-size: 13px; font-weight: 700; padding: 2px 6px; border-radius: 4px; cursor: pointer; text-transform: capitalize; letter-spacing: 0.5px; white-space: nowrap; }
.task-title {font-size: .95em;}
/* History & UI */
.history-list { text-align: left; max-height: 300px; overflow-y: auto; margin: 15px 0; border: 1px solid var(--border-color); border-radius: 8px; scrollbar-width: thin; scrollbar-color:var(--accent-color) #e1e5e500;}
.history-item { padding: 16px 16px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.history-item:hover {background: var(--row-hover-bg);}
#add-column-btn:hover{ background-color: #440795;box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.15);}
#add-column-btn{background:var(--primary-btn-color);color:white;}


.toast:hover{ background-color: #07968c;box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.15);}
.toast { 
    position: absolute;
    left: auto;
    right: auto;
    margin: 0;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    font-weight: 400;
    z-index: 200;
    width: stretch;
    visibility: hidden;
    background: #0aa79c;
    padding: 8px;
    box-shadow:-1px 20px 20px 4px #7abbb761;
    color: white;
    border-radius: 6px;
    padding: 0.7em;
    z-index: 999999;
}
 
.toast-x {
    background: #e9e9ef;
    border: none;
    padding: 4px 8px;
    color: #540606;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    right: 1em;
    top: 0em;
    box-shadow: -5px 20px 20px 0px #7458585c
}
.toast-x:hover {background:#ababb3;}


.add-btn:hover{ background-color: #440795;box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.15);}
.add-btn { user-select: none; margin: 10px 0; padding: 10px; border: none; background:var(--primary-btn-color);color:white;border-radius: 6px; cursor: pointer; font-weight: bold; width: 100%; }
.delete-btn, .color-btn { background: none; border: none; cursor: pointer; opacity: 0.4; font-size: 18px; color: var(--text-color);}
.label { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.green { background: #2ecc71; } .blue { background: #3498db; } .orange { background: #f39c12; }

.inline-input, .inline-textarea { 
  width: 100%; border: 1px solid var(--accent-color); border-radius: 4px; padding: 4px;
  background: var(--bg-color); color: var(--text-color); font-family: inherit; font-size: inherit;
  cursor: text;
}

.inline-input, .inline-textarea:focus {
  outline: none;
  border-color: var(--primary-btn-color);;
}

.board-name {
  position: absolute;
  top: 2px;
  color: var(--text-color);
  font-size: small;
  margin-top: -2px;
}

.history-rename-input {
  background: var(--bg-color);
  color: var(--text-color);
  border: 1px solid var(--accent-color);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 13px;
  width: 90%;
  font-family: inherit;
  outline: none;
}
.btn-edit-history {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.6;
  transform: rotateY(180deg);
}
.btn-edit-history:hover { opacity: 1; }

.search-wrapper {
  display: flex;
  align-items: center;
  border-radius: 20px;
  width: 24px;  
  height: 35px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.search-wrapper.active {
  padding: 0 12px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  width: 355px;
  box-shadow:0 10px 20px rgb(0 0 0 / 15%), 0 6px 6px rgb(0 0 0 / 0%);
  border-color: var(--accent-color);
}

#board-search {
  border: none;
  background: transparent;
  outline: none;
  color: var(--text-color);
  width: 0;
  opacity: 0;
  font-size: 18px;
  margin-left: 10px;
  transition: width 0.3s, opacity 0.2s;
}

.search-wrapper.active #board-search {
  width: 100%;
  opacity: 1;
}

.search-icon {
  flex-shrink: 0;
  user-select: none;
}

#board-search:focus {
  border-color: var(--accent-color);
}

footer { position: fixed; bottom: 10px; left: 20px; z-index: 1001; }


/*auth :modal*/
.auth-section { position: relative; margin-left: 0px; }
#auth-user-pic { 
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; 
  border: 2px solid var(--accent-color); transition: transform 0.2s;
}
#auth-user-pic:hover { transform: scale(1.1); }
#auth-user-name{font-size: small;align-content: space-evenly;color:var(--text-color)}
/* Dropdown Menu */
  .auth-dropdown {
    position: absolute; right: 0; top: 40px; background: var(--card-bg);
    border: 1px solid var(--border-color); padding: 10px; border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); z-index: 1001; min-width: 150px;
  }
  .auth-dropdown p { font-size: 12px; margin-bottom: 10px; opacity: 0.8; overflow: hidden; text-overflow: ellipsis; }

  /* Modal Styles */
  .modal-overlay {
    position: fixed; top:0; left:0; width:100%; height:100%;
    backdrop-filter: blur(4px);overflow: auto;
    background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; z-index: 2000;
  }
  .modal-content {
    background: var(--bg-color); color: var(--text-color); padding: 30px;
    user-select: none;
    border-radius: 15px; text-align: center; border: 1px solid var(--border-color); width: 300px;
  }
  .btn-google {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 10px; border-radius: 5px; border: 1px solid #ddd;
    background: white; color: #444; cursor: pointer; font-weight: bold; margin-top: 10px;
  }
  .btn-google:hover {background: #440795; color: white; }
  .hidden { display: none !important; }
  #magicBtn.loading {
    opacity: 0.6;
    pointer-events: none;
  }

/* Modal Size Override */
.summary-modal-size {
  width: 90%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  max-height: 85vh;  
  padding-bottom: 20px;  
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
 
}

#todaytext{
  margin-bottom: 10px;
}

/* Base Grid Container */
.summary-grid {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  transition: all 0.2s ease-in-out;
}

/* GRID VIEW: Boxy layout */
.summary-grid.view-grid {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

/* LIST VIEW: Full width rows */
.summary-grid.view-list {
  grid-template-columns: 1fr;
}

/* Individual Summary Items */
.summary-item {
  background: var(--card-bg);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: transform 0.1s;
}

.view-list .summary-item {
  flex-direction: row;
  justify-content: space-between;
  padding: 10px 20px;
}

.summary-item h4 { margin: 0; font-size: 14px; color: var(--text-color); opacity: 0.8; }
.summary-item .count { font-size: 20px; font-weight: bold; color: var(--accent-color); }

#summary-body {
  flex: 1; 
  overflow-y: auto; 
  padding-right: 12px;  
  margin-top: 16px;
}

#summary-body::-webkit-scrollbar {
  width: 6px;
}

#summary-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}

.gallery-display {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a; 
  border-radius: 10px;
  margin: 15px 0;
  height: 45vh; 
  overflow: hidden;
}

#gallery-img {
  max-width: 100%;
  max-height: 100%; 
  object-fit: contain; 
  transition: opacity 0.3s ease, transform 0.3s ease;
  border-radius: 12px;
}


.nav-btn {
  position: absolute;
  background:rgb(197 188 188 / 42%);
  color: white;
  border: none;
  padding: 20px 10px;
  cursor: pointer;
  font-size: 24px;
  backdrop-filter: blur(4px);
  transition: 0.2s;
}

.nav-btn:hover { background: rgba(255, 255, 255, 0.2); }
.prev { left: 0; border-radius: 0 8px 8px 0; }
.next { right: 0; border-radius: 8px 0 0 8px; }

.gallery-caption { text-align: center; padding-top: 10px; }
#gallery-text { font-weight: 500; margin-bottom: 5px; color: var(--text-color); }
#gallery-counter { font-size: 0.8em; opacity: 0.5; display: block; margin-bottom: 15px; }

.gallery-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9em;
  opacity: 0.8;
}

#gallery-img, #gallery-text {
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 1;
  transform: translateY(0);
}

.gallery-fade-out {
  opacity: 0 !important;
  transform: translateY(10px) !important;
}

.gallery-display {
  min-height: 424px; 
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

#notification-title{
  font-size: xx-large;
}

#notification-desc{
  text-wrap-style: pretty;
}

#notification{
  max-width: 37%;
}

#paymentsui{
  display: none;
  flex-direction: column;
  gap: 1em;
  border-top: dashed 1px var(--border-color);
  padding-top: 8px;
  margin-top: 4px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 24px;
  }

  .switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }

  .slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 999px;
    transition: 0.3s ease;
    cursor: pointer;
  }

  .slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 8px;
    top: 4px;
    background: white;
    border-radius: 50%;
    transition: 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  }

  input:checked + .slider {
    background: #4caf50;
  }

  input:checked + .slider::before {
    transform: translateX(24px);
  }

  .hideitem{
    display: none;
  }
  
  .syncbtn{
    margin-right: 2em;
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
  }

  .syncbtn:hover {background: cadetblue;}

  .dp{
    height: 1.2em;
    border-radius: 1.2em;
  }

  .loader {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    position: relative;
    vertical-align: middle;
    animation: rotate 1s linear infinite;
    pointer-events: none;
  }
  .loader::before , .loader::after {
    content: "";
    box-sizing: border-box;
    position: absolute;
    inset: 0px;
    border-radius: 50%;
    border: 5px solid #FFF;
    animation: prixClipFix 2s linear infinite ;
  }
  .loader::after{
    inset: 8px;
    transform: rotate3d(90, 90, 0, 180deg );
    border-color: #FF3D00;
  }

  @keyframes rotate {
    0%   {transform: rotate(0deg)}
    100%   {transform: rotate(360deg)}
  }

  @keyframes prixClipFix {
      0%   {clip-path:polygon(50% 50%,0 0,0 0,0 0,0 0,0 0)}
      50%  {clip-path:polygon(50% 50%,0 0,100% 0,100% 0,100% 0,100% 0)}
      75%, 100%  {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,100% 100%,100% 100%)}
  }

  .syncedtag{
    background: #91f5e6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: small;
    pointer-events: none;
  }

  .tagdoc {
    text-decoration: none;
    margin: 2px 2px;
    cursor: pointer;
  }

  .tagdoc:hover {
    text-decoration: none;
    scale: 1.2;
    color: var(--accent-color);
  }

  .uploadBtn {
    background: none;
    border: none;
    text-emphasis: circle;
    cursor: pointer;
    color: var(--text-color);
  }

  .uploadBtn:hover {
    scale: 1.2;
  }
  
  .delete-btn:hover {
    scale: 1.5;
  }

  .color-btn:hover{
    scale:1.2;
  }
 
  thead tr {
    background-color: var(--table-row-head);
  }

  .link{
    text-decoration: underline;
    color: var(--text-color);
    cursor: pointer;
  }

  .link:hover{
    text-decoration: underline;
    color: var(--text-color);
    cursor: pointer;
  }
