/* === MINIMAL DARK AESTHETIC === */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: #0a0a0a;
    color: #e8e8e8;
    line-height: 1.6;
    font-weight: 400;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === HOMEPAGE === */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.search-container {
    width: 100%;
    max-width: 580px;
    position: relative;
}

#searchInput {
    width: 100%;
    padding: 18px 24px;
    font-size: 16px;
    font-weight: 400;
    border: 1px solid #1a1a1a;
    border-radius: 8px;
    background: #111111;
    color: #e8e8e8;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.01em;
}

#searchInput:focus {
    border-color: #333333;
    background: #151515;
    box-shadow: 0 0 0 1px #333333;
}

#searchInput::placeholder {
    color: #666666;
    font-weight: 400;
}

/* Search Results */
.search-results {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #111111;
    border: 1px solid #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    max-height: 420px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.section {
    border-bottom: 1px solid #1a1a1a;
}

.section:last-child {
    border-bottom: none;
}

.section h3 {
    font-size: 11px;
    font-weight: 500;
    color: #666666;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 16px 20px 12px 20px;
}

.result-item {
    padding: 16px 20px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #0f0f0f;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:hover,
.result-item.selected {
    background: #151515;
}

.result-item.selected {
    border-left: 3px solid #e8e8e8;
    padding-left: 17px;
}

.result-title {
    font-weight: 500;
    color: #f0f0f0;
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 1.4;
}

.result-description {
    color: #999999;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.result-url {
    font-size: 11px;
    color: #666666;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    letter-spacing: -0.02em;
}

.link-item .result-title::before {
    content: "↗";
    margin-right: 8px;
    opacity: 0.6;
    font-size: 12px;
}

.note-item .result-title::before {
    content: "⋯";
    margin-right: 8px;
    opacity: 0.6;
    font-size: 12px;
}

.no-results, .error {
    padding: 32px 20px;
    text-align: center;
    color: #666666;
    font-size: 14px;
}

.error {
    color: #cc6666;
}

.match-badge {
    display: inline-block;
    background: #1a1a1a;
    color: #999999;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Footer */
.footer {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
}

.dashboard-link {
    color: #e8e8e8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.dashboard-link:hover {
    background: #111111;
    border-color: #333333;
}

/* === DASHBOARD === */
.dashboard-body {
    background: #0a0a0a;
    min-height: 100vh;
}

.dashboard-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 48px;
}

.dashboard-title {
    font-size: 32px;
    font-weight: 600;
    color: #f0f0f0;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.dashboard-subtitle {
    color: #999999;
    font-size: 15px;
    font-weight: 400;
}

/* Authentication */
.auth-container {
    max-width: 360px;
    margin: 0 auto;
    background: #111111;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    padding: 32px;
}

.auth-input {
    width: 100%;
    padding: 16px;
    border: 1px solid #1a1a1a;
    border-radius: 8px;
    background: #0a0a0a;
    color: #e8e8e8;
    margin-bottom: 16px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
}

.auth-input:focus {
    border-color: #333333;
    background: #111111;
}

.auth-input::placeholder {
    color: #666666;
}

.auth-button {
    width: 100%;
    padding: 16px;
    background: #e8e8e8;
    border: none;
    border-radius: 8px;
    color: #0a0a0a;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-button:hover {
    background: #f0f0f0;
}

/* Dashboard Content */
.dashboard-content {
    display: none;
}

.dashboard-nav {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 32px;
    background: #111111;
    border: 1px solid #1a1a1a;
    border-radius: 8px;
    padding: 4px;
    max-width: 240px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 32px;
}

.nav-button {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #999999;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.nav-button.active,
.nav-button:hover {
    background: #e8e8e8;
    color: #0a0a0a;
}

/* Tab Content */
.tab-content {
    display: none;
    background: #111111;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    padding: 32px;
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    color: #f0f0f0;
    margin-bottom: 24px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #e8e8e8;
    font-weight: 500;
    font-size: 14px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #1a1a1a;
    border-radius: 8px;
    background: #0a0a0a;
    color: #e8e8e8;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: #333333;
    background: #111111;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #666666;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #e8e8e8;
}

.form-button {
    padding: 12px 20px;
    background: #e8e8e8;
    border: none;
    border-radius: 8px;
    color: #0a0a0a;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.form-button:hover {
    background: #f0f0f0;
}

.form-button.delete {
    background: #cc6666;
    color: #ffffff;
}

.form-button.delete:hover {
    background: #d87878;
}

/* Items List */
.items-list {
    margin-top: 32px;
}

.item-card {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.item-card:hover {
    border-color: #333333;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.item-title {
    font-weight: 600;
    color: #f0f0f0;
    font-size: 16px;
    letter-spacing: -0.01em;
}

.item-meta {
    font-size: 12px;
    color: #666666;
    margin-bottom: 8px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.item-description {
    color: #999999;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.action-button {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    background: transparent;
    color: #e8e8e8;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.action-button:hover {
    background: #111111;
    border-color: #333333;
}

.logout-button {
    position: absolute;
    top: 40px;
    right: 40px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    color: #e8e8e8;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
}

.logout-button:hover {
    background: #111111;
    border-color: #333333;
}

/* === NOTE VIEW === */
.note-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
}

.note-header {
    margin-bottom: 40px;
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 32px;
}

.note-title {
    font-size: 28px;
    font-weight: 600;
    color: #f0f0f0;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.note-meta {
    color: #666666;
    font-size: 13px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.note-content {
    color: #e8e8e8;
    line-height: 1.7;
    font-size: 15px;
}

.note-content h1,
.note-content h2,
.note-content h3,
.note-content h4,
.note-content h5,
.note-content h6 {
    color: #f0f0f0;
    margin: 32px 0 16px 0;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.note-content h1 { font-size: 24px; }
.note-content h2 { font-size: 20px; }
.note-content h3 { font-size: 18px; }

.note-content p {
    margin-bottom: 16px;
}

.note-content code {
    background: #111111;
    border: 1px solid #1a1a1a;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
    color: #f0f0f0;
}

.note-content pre {
    background: #111111;
    border: 1px solid #1a1a1a;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    font-size: 13px;
}

.note-content pre code {
    background: none;
    border: none;
    padding: 0;
}

.note-content blockquote {
    border-left: 3px solid #333333;
    padding-left: 16px;
    margin: 16px 0;
    font-style: italic;
    color: #999999;
}

.note-content ul,
.note-content ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

.note-content li {
    margin-bottom: 4px;
}

.back-button {
    position: fixed;
    top: 40px;
    left: 40px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    color: #e8e8e8;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
}

.back-button:hover {
    background: #111111;
    border-color: #333333;
}

/* === 404 PAGE === */
.error-container {
    text-align: center;
    padding: 80px 20px;
}

.error-title {
    font-size: 48px;
    font-weight: 700;
    color: #333333;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.error-message {
    font-size: 16px;
    color: #999999;
    margin-bottom: 32px;
    font-weight: 400;
}

.error-link {
    color: #e8e8e8;
    text-decoration: none;
    padding: 12px 20px;
    border: 1px solid #1a1a1a;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    display: inline-block;
}

.error-link:hover {
    background: #111111;
    border-color: #333333;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .dashboard-container {
        padding: 20px;
    }
    
    .dashboard-title {
        font-size: 24px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .dashboard-nav {
        max-width: 100%;
    }
    
    .logout-button {
        position: static;
        margin-bottom: 20px;
        display: block;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }
    
    .note-container {
        padding: 20px;
    }
    
    .note-title {
        font-size: 22px;
    }
    
    .back-button {
        position: static;
        display: inline-block;
        margin-bottom: 20px;
    }
    
    .auth-container {
        margin: 20px;
        padding: 24px;
    }
    
    #searchInput {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444444;
}

/* === SELECTION === */
::selection {
    background: #333333;
    color: #f0f0f0;
}

::-moz-selection {
    background: #333333;
    color: #f0f0f0;
}