/* Modern Minimalist Theme */
:root {
    --primary: #4A70A9;
    --background: #1a1a1a;
    --secondary: #2d3748;
    --text: #ffffff;
    --text-light: #a0aec0;
    --border: #2d3748;
    --card-bg: #2d2d2d;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 5px 15px rgba(0, 0, 0, 0.4);
    --radius: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--background);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    font-weight: 400;
}

/* Layout */
.main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-area {
    flex: 1;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 768px) {
    .content-area {
        padding: 2rem;
    }
}

/* Navigation */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
    text-decoration: none;
}

.brand-logo {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 0.75rem;
}

.navbar-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: background-color 0.2s;
}

.nav-link:hover, .nav-link.active {
    background: var(--secondary);
    color: var(--text);
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .navbar-toggle {
        display: block;
    }
    
    .navbar-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card-bg);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow);
        border-top: 1px solid var(--border);
    }
    
    .navbar-nav.open {
        display: flex;
    }
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.card-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .card-body {
        padding: 2rem;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.form-control, .form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text);
    transition: border-color 0.2s;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-control::placeholder {
    color: var(--text-light);
}

.form-text {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--card-bg);
    cursor: pointer;
}

.file-upload-area:hover, .file-upload-area.dragover {
    border-color: var(--primary);
    background: var(--secondary);
}

.file-input {
    display: none;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.file-info {
    padding: 1rem;
    background: var(--secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-top: 1rem;
    display: none;
}

.file-icon {
    font-size: 1.5rem;
}

@media (min-width: 768px) {
    .file-upload-area {
        padding: 3rem 2rem;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
}

/* Notes Grid */
.notes-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.note-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.note-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.note-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.note-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    margin-right: 1rem;
    flex-shrink: 0;
}

.note-meta {
    flex: 1;
}

.note-author {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.note-category {
    background: var(--secondary);
    color: var(--text);
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.note-date {
    color: var(--text-light);
    font-size: 0.875rem;
    white-space: nowrap;
}

.note-content {
    flex: 1;
    margin-bottom: 1rem;
}

.note-preview {
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
    line-height: 1.5;
}

.note-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.note-action {
    flex: 1;
    background: var(--secondary);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem;
    border-radius: var(--radius);
    font-size: 0.8rem;
    transition: all 0.2s ease;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
}

.note-action:hover {
    background: var(--primary);
    color: white;
}

@media (min-width: 576px) {
    .notes-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    
    .note-avatar {
        width: 48px;
        height: 48px;
    }
    
    .note-author {
        font-size: 1.1rem;
    }
    
    .note-action {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

@media (min-width: 992px) {
    .notes-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-hover);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

img {
    max-width: 25%;
    max-height: 25%;
    margin-bottom: 20px;
}
.login-logo {
    width: 20px;
    height: 20px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem auto;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-light);
    font-size: 1rem;
}

@media (min-width: 768px) {
    .login-card {
        padding: 3rem 2.5rem;
    }
    
    .login-logo {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .login-title {
        font-size: 2rem;
    }
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    text-align: center;
    padding: 1.25rem 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .stat-card {
        padding: 1.5rem 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* Search */
.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-box input {
    padding-left: 2.5rem;
    border-radius: 20px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

/* Empty State */
.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-icon {
    font-size: 3rem;
    opacity: 0.5;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .empty-state {
        padding: 4rem 2rem;
    }
    
    .empty-icon {
        font-size: 4rem;
    }
}

/* Loading States */
.loading-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alerts */
.alert {
    position: fixed;
    top: 1rem;
    right: 1rem;
    left: 1rem;
    z-index: 1050;
    max-width: 400px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-danger {
    border-left: 4px solid #e74c3c;
}

.alert-success {
    border-left: 4px solid #2ecc71;
}

.alert-warning {
    border-left: 4px solid #f39c12;
}

.alert-info {
    border-left: 4px solid #3498db;
}

.alert-close {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    margin-left: 1rem;
}

@media (min-width: 768px) {
    .alert {
        left: auto;
        margin: 0;
    }
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.col {
    flex: 1;
    padding: 0 0.75rem;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 0.75rem;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 0.75rem;
}

.col-lg-9 {
    flex: 0 0 75%;
    max-width: 75%;
    padding: 0 0.75rem;
}

.col-lg-3 {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0 0.75rem;
}

@media (max-width: 768px) {
    .col-md-6, .col-lg-9, .col-lg-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Text Utilities */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-light);
}

.mb-0 {
    margin-bottom: 0;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

/* Flex Utilities */
.d-flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-center {
    justify-content: center;
}

.align-items-center {
    align-items: center;
}

.gap-2 {
    gap: 0.5rem;
}

/* Markdown Editor */
.markdown-editor {
    display: flex;
    flex-direction: column;
    height: 400px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.markdown-toolbar {
    background: var(--secondary);
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
}

.markdown-toolbar button {
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.2s;
}

.markdown-toolbar button:hover {
    background: var(--primary);
    color: white;
}

.markdown-content {
    flex: 1;
    display: flex;
}

.markdown-input, .markdown-preview {
    flex: 1;
    padding: 1rem;
    border: none;
    resize: none;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
}

.markdown-input {
    border-right: 1px solid var(--border);
}

.markdown-preview {
    overflow-y: auto;
    background: var(--card-bg);
}

@media (max-width: 768px) {
    .markdown-content {
        flex-direction: column;
    }
    
    .markdown-input, .markdown-preview {
        min-height: 200px;
    }
    
    .markdown-input {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}