/**
 * Notepad Website Styles
 * Created by: Shakir Hossain
 * Web: shakir.com.bd
 * Email: admin@shakir.com.bd
 */

:root{
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --brand: #2563eb;
  --danger: #ef4444;
}

html[data-theme="dark"]{
  --bg: #0b1220;
  --card: #0f172a;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #1f2a44;
  --brand: #60a5fa;
  --danger: #fb7185;
}

body{
  background: var(--bg);
  color: var(--text);
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
}

.muted{ color: var(--muted); }

.toast{
  background: var(--card);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  margin-top: 8px;
}
.toast.success{ border-left: 4px solid #22c55e; }
.toast.error{ border-left: 4px solid var(--danger); }
.toast.info{ border-left: 4px solid var(--brand); }

.folderRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 6px 6px;
  border-radius: 12px;
}
.folderBtn{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  text-align:left;
  font-size: 13px;
}
.folderBtn:hover{ background: rgba(37,99,235,.08); }
html[data-theme="dark"] .folderBtn:hover{ background: rgba(96,165,250,.12); }
.folderBtn.active{
  background: rgba(37,99,235,.12);
  border-color: rgba(37,99,235,.25);
}
.folderActions{ display:flex; gap:6px; opacity:.85; }
.iconBtn{
  width:32px;height:32px;
  border-radius:10px;
  border:1px solid var(--border);
  background: var(--card);
  font-size: 13px;
}
.iconBtn:hover{ transform: translateY(-1px); }
.iconBtn.danger:hover{ border-color: var(--danger); }

.noteRow{
  width:100%;
  text-align:left;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
}
.noteRow:hover{ background: rgba(100,116,139,.08); }
.noteRow.active{
  border-color: rgba(37,99,235,.25);
  background: rgba(37,99,235,.10);
}

.autosaveDot{
  width:10px;height:10px;border-radius:999px;
  background: rgba(100,116,139,.35);
  transition: transform .15s ease, background .15s ease;
}
.autosaveDot.on{
  background: #22c55e;
  transform: scale(1.2);
}

/* Quill dark tweaks */
html[data-theme="dark"] .ql-toolbar.ql-snow,
html[data-theme="dark"] .ql-container.ql-snow{
  border-color: var(--border);
}
html[data-theme="dark"] .ql-toolbar.ql-snow{
  background: rgba(255,255,255,.02);
}
html[data-theme="dark"] .ql-editor{
  color: var(--text);
}

/* Prose (note view) dark mode */
html[data-theme="dark"] .prose{
  color: var(--text);
}
html[data-theme="dark"] .prose :where(p, li, blockquote, strong, em, code, pre, h1, h2, h3, h4, h5, h6){
  color: var(--text);
}
html[data-theme="dark"] .prose a{
  color: var(--brand);
}
html[data-theme="dark"] .prose hr{
  border-color: var(--border);
}

:root {
    --primary-color: #4a90e2;
    --secondary-color: #50c878;
    --danger-color: #e74c3c;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 5px 20px rgba(0,0,0,0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark-color);
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    animation: fadeInLeft 0.6s ease-out;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.logo i {
    font-size: 28px;
    animation: rotateIn 0.8s ease-out;
}

@keyframes rotateIn {
    from {
        transform: rotate(-180deg);
        opacity: 0;
    }
    to {
        transform: rotate(0);
        opacity: 1;
    }
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-icon {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 15px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeInRight 0.6s ease-out;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.btn-icon:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-icon i {
    font-size: 16px;
}

.user-menu {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1001;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px solid var(--light-color);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--light-color);
    padding-left: 25px;
}

.dropdown-item i {
    margin-right: 10px;
    color: var(--primary-color);
}

.guest-message {
    padding: 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    margin: 10px;
    border-radius: 5px;
    font-size: 13px;
    line-height: 1.6;
}

/* Main Content */
.main-content {
    padding: 30px 0;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow-lg);
    animation: slideInLeft 0.6s ease-out;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-color);
}

.sidebar-header h3 {
    color: var(--dark-color);
    font-size: 20px;
}

.sidebar-search {
    position: relative;
    margin-bottom: 20px;
}

.sidebar-search input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 14px;
    transition: var(--transition);
}

.sidebar-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.sidebar-search i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
}

.folders-section {
    margin-bottom: 20px;
}

.folders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--dark-color);
}

.folders-list {
    list-style: none;
}

.folder-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
    border-radius: 8px;
    transition: var(--transition);
}

.folder-list-item:hover {
    background: var(--light-color);
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    padding: 10px 15px;
    color: var(--dark-color);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
}

.folder-item:hover {
    background: var(--light-color);
    transform: translateX(5px);
}

.folder-item.active {
    background: var(--primary-color);
    color: white;
}

.folder-item i {
    font-size: 14px;
    width: 16px;
}

.folder-delete-btn {
    background: transparent;
    border: none;
    color: #999;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.folder-list-item:hover .folder-delete-btn {
    opacity: 1;
    visibility: visible;
}

.folder-delete-btn:hover {
    background: var(--danger-color);
    color: white;
    transform: scale(1.1);
}

.folder-delete-btn i {
    font-size: 12px;
}

.notes-list {
    margin-top: 20px;
}

.note-item {
    padding: 15px;
    background: white;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--transition);
    border-left: 4px solid transparent;
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.note-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
    border-left-color: var(--primary-color);
}

.note-item.active {
    border-left-color: var(--primary-color);
    background: #f0f7ff;
}

.note-item-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--dark-color);
}

.note-item-preview {
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-item-date {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

/* Editor Area */
.editor-area {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: slideInRight 0.6s ease-out;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 150px);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.editor-header {
    padding: 20px;
    border-bottom: 2px solid var(--light-color);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.note-title-input {
    width: 100%;
    padding: 15px;
    font-size: 24px;
    font-weight: bold;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 10px;
    margin-bottom: 15px;
    transition: var(--transition);
}

.note-title-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.note-title-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.btn-action {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 15px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-action.btn-danger {
    background: rgba(231, 76, 60, 0.8);
    border-color: rgba(231, 76, 60, 0.9);
}

.btn-action.btn-danger:hover {
    background: rgba(231, 76, 60, 1);
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch input[type="checkbox"] {
    width: 50px;
    height: 25px;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.toggle-switch input[type="checkbox"]:checked {
    background: var(--secondary-color);
}

.toggle-switch input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 2.5px;
    left: 2.5px;
    transition: var(--transition);
}

.toggle-switch input[type="checkbox"]:checked::before {
    left: 27.5px;
}

.toggle-label {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.editor-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.note-content {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: none;
    font-size: 16px;
    line-height: 1.8;
    resize: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dark-color);
    background: transparent;
}

.note-content:focus {
    outline: none;
}

.share-link-container {
    padding: 20px;
    background: var(--light-color);
    border-top: 2px solid var(--border-color);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.share-link-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-link-box label {
    font-weight: 600;
    color: var(--dark-color);
}

.share-link-box input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 14px;
}

.btn-copy-link {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-copy-link:hover {
    background: #357abd;
    transform: scale(1.05);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: scaleIn 0.3s ease-out;
    box-shadow: var(--shadow-lg);
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--danger-color);
    transform: rotate(90deg);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--dark-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.btn-primary:hover {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Footer */
.footer {
    background: rgba(44, 62, 80, 0.9);
    color: white;
    padding: 25px 0;
    text-align: center;
    margin-top: 30px;
    animation: fadeIn 0.8s ease-out;
}

.footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.footer p {
    margin: 0;
    line-height: 1.6;
}

.footer p:first-child {
    font-size: 16px;
    font-weight: 500;
}

.footer p:last-child {
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.footer a {
    color: white;
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.footer a:hover {
    color: var(--primary-color);
    text-decoration: underline;
    transform: translateY(-2px);
}

.footer strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    animation: slideInRight 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
}

.toast.success {
    border-left: 4px solid var(--secondary-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.info {
    border-left: 4px solid var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 300px;
    }

    .editor-area {
        min-height: auto;
    }

    .nav-menu {
        flex-wrap: wrap;
    }

    .btn-icon span {
        display: none;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #357abd;
}
