:root {
    --bg-color: #0d0714;
    --surface-color: #1a0b2e;
    --surface-border: #2d1b4e;
    --primary-color: #bb86fc;
    --primary-hover: #9d4edd;
    --danger-color: #ff5252;
    --text-main: #ffffff;
    --text-muted: #a0a0b0;
    --font-family:
        system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
}

.center-layout {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Auth Card */
.auth-card {
    background: var(--surface-color);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.auth-card h1 {
    font-size: 24px;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.input-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 13px;
    color: var(--text-muted);
}

input[type="text"],
input[type="password"] {
    background: var(--bg-color);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition:
        opacity 0.2s,
        background-color 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--bg-color);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--surface-border);
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
}

.btn-danger:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--surface-border);
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
}

.auth-toggle {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Navbar */
.navbar {
    height: 60px;
    border-bottom: 1px solid var(--surface-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--bg-color);
}

.nav-brand {
    font-weight: 700;
    font-size: 18px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Container & Views */
.container {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 16px;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.note-card {
    background: var(--surface-color);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    aspect-ratio: 1 / 1; /* Kare form factor */
    transition:
        transform 0.15s,
        border-color 0.15s,
        background-color 0.15s;
}

.note-card:hover {
    border-color: var(--primary-color);
    background-color: #210e3b;
    transform: translateY(-2px);
}

.note-title {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.3;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.note-date {
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.8;
}

/* Liste Görünümü (Alternatif mod) */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notes-list .note-card {
    aspect-ratio: auto;
    flex-direction: row;
    align-items: center;
    padding: 14px 18px;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: var(--bg-color);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.dialog-content {
    max-width: 420px;
    height: auto;
    gap: 12px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 12px;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body {
    flex: 1;
    padding-top: 12px;
}

.borderless-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-main);
    outline: none;
    font-family: inherit;
}

.title-input {
    font-size: 20px;
    font-weight: 700;
}

.content-input {
    height: 100%;
    resize: none;
    font-size: 15px;
    line-height: 1.5;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--surface-color);
    border: 1px solid var(--surface-border);
    color: var(--text-main);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 200;
}

.hidden {
    display: none !important;
}

.warning-text {
    color: var(--danger-color);
    font-size: 13px;
    line-height: 1.4;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}
