/* assets/style.css */

:root{
  --paper: #fbf7ef;
  --paper-dark: #f3e9d7;
  --ink: #2b2b2b;
  --accent: #3b82f6;
  --accent-2:#10b981;
  --danger:#ef4444;
}

*{ box-sizing:border-box; }
body{
  margin:0; font-family: system-ui, sans-serif; color:var(--ink);
  background: repeating-linear-gradient(
    0deg, var(--paper) 0px, var(--paper) 24px,
    #e9dfcc 25px
  );
}

/* Notebook-Look */
.notebook{
  background: var(--paper);
  border: 2px solid #e4d6ba;
  border-radius: 18px;
  box-shadow:
    0 12px 30px rgba(0,0,0,.10),
    inset 0 0 0 1px rgba(255,255,255,.6);
  position: relative;
}

/* kleine Ring-Bindung links */
.notebook::before{
  content:"";
  position:absolute; left:-10px; top:12px; bottom:12px;
  width:16px; border-radius:10px;
  background:
    radial-gradient(circle at 8px 12px, #999 0 5px, transparent 6px),
    radial-gradient(circle at 8px 52px, #999 0 5px, transparent 6px),
    radial-gradient(circle at 8px 92px, #999 0 5px, transparent 6px),
    radial-gradient(circle at 8px 132px, #999 0 5px, transparent 6px),
    radial-gradient(circle at 8px 172px, #999 0 5px, transparent 6px);
  opacity:.45;
}

.topbar{
  margin:16px;
  padding:12px 16px;
  display:flex; align-items:center; justify-content:space-between;
}
.brand{ font-weight:700; font-size:20px; }
.topbar a{ color:var(--accent); text-decoration:none; }

/* Desktop-Layout: Kalender links, To-do rechts */
.layout{
  display: flex;
  gap: 16px;
  padding: 0 16px 16px;
  align-items: flex-start;
}

.calendar{
  flex: 1 1 auto;
  min-width: 0;  /* verhindert Überlauf */
  padding:12px; min-height: 70vh;
}

.todos{
  flex: 0 0 360px;
  padding:14px;
}
.todos h2{ margin-top:0; }

.todo-form input, .todo-form textarea{
  width:100%; padding:8px 10px; margin:6px 0 10px;
  border-radius:10px; border:1px solid #e6d8bd;
  background:#fffdf7; font:inherit;
}
.todo-form textarea{ min-height:60px; resize:vertical; }

.row{ display:flex; flex-direction:column; gap:6px; margin:8px 0; }
.checkbox{ flex-direction:row; align-items:center; }

.btn{
  background:var(--accent);
  color:white; border:none; padding:8px 12px;
  border-radius:10px; cursor:pointer; font-weight:600;
  box-shadow:0 4px 0 rgba(0,0,0,.1);
}
.btn:hover{ filter:brightness(.95); }
.btn.ghost{ background:#e9e1d1; color:#333; }
.btn.danger{ background:var(--danger); }

.todo-list{ list-style:none; padding:0; margin:10px 0 0; display:grid; gap:8px;}
.todo-item{
  background:#fffdf7; border:1px dashed #dbc7a0; border-radius:12px;
  padding:8px 10px; display:grid; gap:6px;
  cursor: grab;
}
.todo-item:active{ cursor: grabbing; }
.todo-item.done{ opacity:.6; text-decoration:line-through; }
.todo-check{ display:flex; gap:8px; align-items:center; font-weight:600; }
.meta{ font-size:12px; color:#555; }
.actions{ display:flex; justify-content:flex-end; }
.mini{
  border:none; background:#eee; padding:4px 8px; border-radius:8px; cursor:pointer;
}
.mini.danger{ background:#fee2e2; color:#991b1b; }

.hint{ font-size:12px; opacity:.7; margin-top:6px; }

/* Modal */
.modal{
  position:fixed; inset:0; background:rgba(0,0,0,.35);
  display:flex; align-items:center; justify-content:center;
  padding:16px; z-index:999;
}
.hidden{ display:none; }
.modal-card{
  width:min(520px, 100%); padding:14px;
}
.modal-card input, .modal-card textarea{
  width:100%; padding:8px 10px; border-radius:10px;
  border:1px solid #e6d8bd; background:#fffdf7; font:inherit;
  margin:6px 0 10px;
}
.modal-actions{
  display:flex; gap:8px; justify-content:flex-end; margin-top:6px;
}

/* Login */
.login-bg{
  height:100vh; display:flex; align-items:center; justify-content:center;
}
.login-card{ width:min(420px, 100%); padding:20px; }
.alert{
  background:#fee2e2; border:1px solid #fecaca; padding:8px; border-radius:8px;
  margin-bottom:8px;
}

/* ------------------------------
   To-Do Header + Collapse
---------------------------------*/
.todos-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}

.btn.small{
  font-size: 0.9rem;
  padding: 6px 10px;
}

.collapse{
  overflow: hidden;
  transition: max-height .25s ease, opacity .25s ease, transform .25s ease;
  max-height: 800px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 10px;
}

.collapse.closed{
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  margin-top: 0;
  pointer-events: none;
}

.todos .collapse:not(.closed){
  border-top: 1px dashed #dbc7a0;
  padding-top: 10px;
}

/* ------------------------------
   Mobile: To-do oben, Kalender darunter
---------------------------------*/
@media (max-width: 980px){
  .layout{
    flex-direction: column;
  }
  .todos{ order: 1; flex: 1 1 auto; width:100%; }
  .calendar{ order: 2; width:100%; min-height:55vh; }

  .topbar{
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
}

@media (max-width: 520px){
  .topbar{ margin: 10px; }
  .layout{ padding: 0 10px 10px; gap:10px; }
  .calendar, .todos{ padding: 10px; border-radius: 14px; }

  .fc .fc-toolbar{
    flex-wrap: wrap;
    gap: 6px;
  }
  .fc .fc-toolbar-title{
    font-size: 1.1rem;
  }
}

/* ------------------------------
   Responsive Login (Smartphone)
---------------------------------*/
@media (max-width: 980px){
  .login-bg{
    padding: 16px;              /* weniger “gequetscht” am Rand */
  }

  .login-card{
    width: 100%;
    max-width: 520px;           /* größer als vorher */
    padding: 60px;
  }

  .login-card h1{
    font-size: 1.8rem;
  }

  .login-card label{
    font-size: 1.2rem;
  }

  .login-card input{
    font-size: 1.3rem;
    padding: 5px 5px;         /* größere Touch-Ziele */
    border-radius: 12px;
  }

  .login-card .btn{
    width: 100%;
    font-size: 1.1rem;
    padding: 20px 14px;
    margin-top: 30px;
  }
}

@media (max-width: 520px){
  .login-card{
    max-width: 100%;
    padding: 22px;
    border-radius: 16px;
  }

  .login-card h1{
    font-size: 1.6rem;
  }

  .login-card input{
    font-size: 1.02rem;
    padding: 12px;
  }
}

@media (max-width: 360px){
  .login-card{
    padding: 18px;
  }

  .login-card h1{
    font-size: 1.4rem;
  }
}

