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

body {
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #333333;
    background: #f7f7f7;
    min-height: 100vh;
}

a {
    color: #3a3a3a;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   Layout
   --------------------------------------------------------------------------- */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------------------------------------------------------------------------
   Header
   --------------------------------------------------------------------------- */
.site-header {
    background: #3a3a3a;
    padding: 14px 0;
    margin-bottom: 24px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 500;
    font-size: 20px;
    color: #ffffff;
    text-decoration: none;
}

.logo:hover {
    text-decoration: none;
}

.site-header nav {
    display: flex;
    gap: 16px;
}

.site-header nav a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.site-header nav a:hover {
    color: #ffffff;
    text-decoration: none;
}

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */
.site-footer {
    margin-top: 40px;
    padding: 20px 0;
    text-align: center;
    color: #999999;
    font-size: 12px;
}

/* ---------------------------------------------------------------------------
   Flash messages
   --------------------------------------------------------------------------- */
.flash {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 700;
}

.flash-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ---------------------------------------------------------------------------
   Headings
   --------------------------------------------------------------------------- */
h1, h2, h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 500;
    color: #3a3a3a;
}

h1 { font-size: 26px; margin-bottom: 16px; }
h2 { font-size: 22px; margin-bottom: 12px; }
h3 { font-size: 18px; margin-bottom: 8px; }

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
}

.btn-primary {
    background: #3a3a3a;
    color: #ffffff;
}

.btn-primary:hover {
    background: #2a2a2a;
    text-decoration: none;
    color: #ffffff;
}

.btn-danger {
    background: #c0392b;
    color: #ffffff;
}

.btn-danger:hover {
    background: #a93226;
    text-decoration: none;
    color: #ffffff;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333333;
}

.btn-secondary:hover {
    background: #d0d0d0;
    text-decoration: none;
}

.btn-full {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666666;
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 15px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #ffffff;
    color: #333333;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3a3a3a;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Radio group for weight */
.weight-options {
    display: flex;
    gap: 16px;
    margin-top: 6px;
}

.weight-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
}

.weight-option input[type="radio"] {
    accent-color: #3a3a3a;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* ---------------------------------------------------------------------------
   Dashboard actions (search + add button inline)
   --------------------------------------------------------------------------- */
.dashboard-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    padding: 0 14px;
    height: 40px;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 14px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #ffffff;
    color: #333333;
    transition: border-color 0.2s;
    width: 200px;
}

.search-input:focus {
    outline: none;
    border-color: #3a3a3a;
}

.dashboard-actions .btn {
    height: 40px;
    line-height: 40px;
    padding: 0 20px;
    white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------------- */
.card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 16px;
}

/* ---------------------------------------------------------------------------
   Note cards
   --------------------------------------------------------------------------- */
.note-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #999999;
    border-radius: 0 4px 4px 0;
    padding: 16px;
    margin-bottom: 12px;
}

.note-card-archived {
    opacity: 0.5;
}

.note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.category-pill {
    display: inline-block;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 12px;
    color: #ffffff;
}

.note-meta {
    font-size: 12px;
    color: #999999;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.note-content {
    font-size: 14px;
    line-height: 1.6;
    color: #333333;
    margin-bottom: 10px;
    word-break: break-word;
}

.note-content a {
    color: #3a3a3a;
    text-decoration: underline;
}

.note-actions {
    display: flex;
    gap: 12px;
    font-size: 13px;
}

.note-actions a {
    color: #666666;
}

.note-actions a:hover {
    color: #3a3a3a;
}

.weight-badge {
    display: inline-block;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 3px;
    color: #ffffff;
}

.weight-1 { background: #bdc3c7; }
.weight-2 { background: #7f8c8d; }
.weight-3 { background: #3a3a3a; }

/* ---------------------------------------------------------------------------
   Category filter
   --------------------------------------------------------------------------- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.filter-pill {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 20px;
    border: 1px solid #d0d0d0;
    color: #666666;
    background: #ffffff;
    text-decoration: none;
    transition: all 0.2s;
}

.filter-pill:hover {
    border-color: #3a3a3a;
    color: #3a3a3a;
    text-decoration: none;
}

.filter-pill.active {
    background: #3a3a3a;
    border-color: #3a3a3a;
    color: #ffffff;
}

/* ---------------------------------------------------------------------------
   Dashboard header
   --------------------------------------------------------------------------- */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.note-count {
    font-size: 14px;
    color: #999999;
}

/* ---------------------------------------------------------------------------
   Login page
   --------------------------------------------------------------------------- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 16px;
}

.login-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 36px 32px;
    width: 100%;
    max-width: 380px;
}

.login-title {
    text-align: center;
    font-size: 28px;
    margin-bottom: 4px;
}

.login-subtitle {
    text-align: center;
    color: #999999;
    font-size: 14px;
    margin-bottom: 24px;
}

/* ---------------------------------------------------------------------------
   Archive (public) page
   --------------------------------------------------------------------------- */
.archive-card {
    max-width: 520px;
    margin: 40px auto;
    text-align: center;
}

.archive-note-preview {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}

.archive-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ---------------------------------------------------------------------------
   Empty state
   --------------------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999999;
}

.empty-state p {
    margin-bottom: 16px;
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 600px) {
    .header-inner {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .site-header nav {
        gap: 12px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-actions {
        flex-direction: row;
    }

    .search-input {
        flex: 1;
        width: auto;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .weight-options {
        flex-direction: column;
        gap: 10px;
    }

    .note-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .archive-actions {
        flex-direction: column;
    }

    .archive-actions .btn {
        width: 100%;
    }
}
