:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --bg-color: #0f172a;
    --container-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --input-bg: rgba(15, 23, 42, 0.6);
    --input-border: rgba(79, 70, 229, 0.3);
    --input-focus: rgba(79, 70, 229, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Dynamic Animated Background */
.background-animation {
    position: absolute;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    z-index: -1;
    overflow: hidden;
}

.blur-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: drift 20s infinite alternate ease-in-out;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: rgba(79, 70, 229, 0.3);
    top: -150px;
    left: -150px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: rgba(139, 92, 246, 0.25);
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(40px, -60px) scale(1.1);
    }

    66% {
        transform: translate(-30px, 30px) scale(0.9);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

.login-container {
    background: var(--container-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(20px);
    opacity: 0;
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(79, 70, 229, 0.5);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: block;
}

.profile-avatar:hover {
    transform: scale(1.08) rotate(3deg);
    border-color: var(--primary-color);
}

.login-header h1 {
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
    width: 100%;
    display: block;
}

.input-group i:first-child {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: color 0.3s ease;
    z-index: 2;
}

.input-group input {
    width: 100%;
    padding: 1.1rem 3rem 1.1rem 3.2rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 14px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-group input:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
    background: rgba(15, 23, 42, 0.8);
}

.input-group input:focus+i {
    color: var(--primary-color);
}

.toggle-password {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    z-index: 5;
}

.toggle-password:hover {
    color: #e2e8f0;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    width: 100%;
}

.remember-me {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
    position: relative;
}

.remember-me:hover {
    color: #e2e8f0;
}

.remember-me input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
    pointer-events: none;
}

.checkmark {
    height: 20px;
    width: 20px;
    background-color: rgba(15, 23, 42, 0.8);
    border: 2px solid var(--input-border);
    border-radius: 6px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remember-me:hover input~.checkmark {
    border-color: var(--input-focus);
}

.remember-me input:checked~.checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -1px;
}

.remember-me input:checked~.checkmark:after {
    display: block;
}

.forgot-password {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.forgot-password:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, var(--primary-color), #8B5CF6);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.6);
}

.btn-login:active {
    transform: translateY(0);
}

.security-badge {
    margin-top: 2rem;
    text-align: center;
    color: #10B981;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.security-badge i {
    font-size: 1rem;
}

@media (max-width: 480px) {
    .login-container {
        padding: 2rem;
        width: 92%;
        border-radius: 20px;
    }
}

/* =========================================
   NOTLAR MODÜLÜ CSS
========================================= */

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 1.5rem;
    gap: 1.5rem;
    box-sizing: border-box;
    /* Reset any global body centering if needed */
    position: absolute;
    top: 0;
    left: 0;
}

/* Sidebar Styles */
.sidebar {
    width: 300px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.back-btn {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.back-btn:hover {
    color: var(--text-main);
}

.category-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.category-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.category-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent);
    border-color: rgba(99, 102, 241, 0.3);
}

.category-item .delete-cat {
    color: #ef4444;
    opacity: 0;
    transition: opacity 0.2s;
}

.category-item:hover .delete-cat {
    opacity: 1;
}

.add-category-form {
    padding: 1rem;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
}

.form-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    outline: none;
    margin-bottom: 0.5rem;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: var(--accent);
}

.btn {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    background: var(--content-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0 1rem;
    flex: 1;
    max-width: 400px;
    transition: border-color 0.3s;
}

.search-box:focus-within {
    border-color: var(--accent);
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 0.8rem 0.5rem;
    outline: none;
    width: 100%;
}

.notes-list {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: min-content;
    gap: 1.5rem;
    align-items: start;
    align-content: start;
}

.note-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 100px;
    /* Force minimum height to prevent squishing */
}

.note-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    background: rgba(30, 41, 59, 0.8);
}

.note-body {
    padding: 1.2rem;
    flex: 1;
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.note-icon {
    font-size: 1.2rem;
    color: var(--accent);
    opacity: 0.8;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.8rem;
    border-radius: 12px;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.note-title-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.note-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0 0 0.8rem 0;
    /* Increased margin for exact spacing */
    color: #fff;
    line-height: 1.4;
    word-wrap: break-word;
}

.note-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    /* Push to bottom of wrapper */
}

.note-category-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    color: #e2e8f0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: #1e293b;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 100%;
    max-width: 1200px;
    height: 95vh;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-title-input {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    outline: none;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.modal-select {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    outline: none;
    margin-bottom: 1rem;
    width: 100%;
    font-family: inherit;
}

.modal-textarea {
    width: 100%;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 1.5rem;
    border-radius: 12px;
    outline: none;
    resize: vertical;
    flex: 1;
    min-height: 50vh;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    white-space: pre-wrap;
}

.modal-textarea:focus {
    border-color: var(--accent);
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.1);
}

.close-modal {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* File Input */
input[type="file"] {
    border: 1px dashed var(--glass-border);
    padding: 1rem;
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-muted);
    width: 100%;
    border-radius: 8px;
    margin-bottom: 1rem;
    cursor: pointer;
}

.preview-image {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 1rem;
    border: 1px solid var(--glass-border);
}

/* =========================================
   DASHBOARD KONTROL PANELİ CSS
========================================= */

.dashboard-container {
    background: var(--container-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 3rem;
    width: 100%;
    max-width: 900px;
    text-align: center;
    color: var(--text-main);
    transform: translateY(20px);
    animation: fadeUp 0.6s forwards;
    margin: 2rem auto;
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 1rem;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: transform 0.3s;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4);
}

/* Grid Styles */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
    margin-bottom: 2rem;
}

.module-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem 1rem;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    position: relative;
}

.module-card:hover {
    transform: translateY(-8px);
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(79, 70, 229, 0.5);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(79, 70, 229, 0.2);
}

.module-icon {
    font-size: 2.8rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, var(--primary-color), #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.module-card:hover .module-icon {
    transform: scale(1.15);
    filter: drop-shadow(0 5px 15px rgba(79, 70, 229, 0.5));
}

.module-title {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #f8fafc;
}

.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1.5rem;
    margin-bottom: 1rem;
}

.dash-header h1 {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0;
    font-size: 1.8rem;
}

.title-icon-box {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.5);
}

.title-icon-box i {
    color: white;
    font-size: 1.4rem;
}

.title-text {
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    font-family: monospace;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 1.5rem 1rem;
        margin: 1rem;
    }

    .dash-header {
        flex-direction: column;
        gap: 1rem;
    }

    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0 0.5rem;
    }

    .module-card {
        padding: 1.5rem 0.5rem;
    }

    .module-icon {
        font-size: 2.2rem;
    }

    .module-title {
        font-size: 0.9rem;
    }
}