* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #faf7f2 0%, #fdf5f7 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    color: #1d1d1f;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

#journal-root {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.journal-window {
    width: 680px;
    max-width: 100%;
    background: linear-gradient(to bottom, #ffffff 0%, #fffbfc 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(255,182,193,0.15), 
                0 8px 24px rgba(0,0,0,0.08),
                0 0 0 1px rgba(250,235,240,0.5) inset;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 85vh;
    max-height: 900px;
    animation: windowIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    position: relative;
}

/* Subtle gradient accent */
.journal-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,192,203,0.4) 20%, 
        rgba(255,182,193,0.6) 50%, 
        rgba(255,192,203,0.4) 80%, 
        transparent 100%);
}

@keyframes windowIn {
    from { opacity: 0; transform: scale(0.96) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Header */
.journal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px 18px;
    border-bottom: 1px solid rgba(255,192,203,0.12);
    background: linear-gradient(to bottom, rgba(255,255,255,0.9) 0%, rgba(255,251,252,0.7) 100%);
    backdrop-filter: blur(10px);
}

.title {
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #1d1d1f 0%, #ff9db5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

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

.icon-btn {
    background: linear-gradient(135deg, rgba(255,192,203,0.1) 0%, rgba(255,182,193,0.15) 100%);
    border: 1px solid rgba(255,192,203,0.2);
    padding: 7px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #1d1d1f;
    border-radius: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.icon-btn:hover {
    background: linear-gradient(135deg, rgba(255,192,203,0.2) 0%, rgba(255,182,193,0.25) 100%);
    border-color: rgba(255,192,203,0.35);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,192,203,0.2);
}

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

/* Editor Container */
.editor-container {
    flex: 1;
    padding: 36px 44px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.editor-container::-webkit-scrollbar {
    width: 10px;
}

.editor-container::-webkit-scrollbar-track {
    background: rgba(255,192,203,0.05);
    border-radius: 10px;
}

.editor-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(255,192,203,0.3) 0%, rgba(255,182,193,0.4) 100%);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.editor-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(255,192,203,0.5) 0%, rgba(255,182,193,0.6) 100%);
    background-clip: padding-box;
}

/* Date stamp */
.date-stamp {
    font-size: 13px;
    background: linear-gradient(135deg, #86868b 0%, #ff9db5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 18px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Editor */
.editor {
    font-size: 18px;
    line-height: 1.7;
    border: none;
    outline: none;
    resize: none;
    color: #1d1d1f;
    min-height: 300px;
    background: transparent;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    transition: font-family 0.2s ease;
}

.editor::placeholder {
    background: linear-gradient(135deg, #c7c7cc 0%, #ffb6c1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.editor:focus::placeholder {
    opacity: 0.5;
}

/* Font classes */
.font-sf-pro { font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif; }
.font-ia-mono { font-family: 'IBM Plex Mono', monospace; font-size: 16px; line-height: 1.8; }
.font-merriweather { font-family: 'Merriweather', serif; font-size: 17px; line-height: 1.8; }
.font-space { font-family: 'Space Grotesk', sans-serif; font-size: 18px; }
.font-crimson { font-family: 'Crimson Pro', serif; font-size: 19px; line-height: 1.7; }
.font-system-mono { font-family: 'Menlo', 'Monaco', 'Courier New', monospace; font-size: 15px; line-height: 1.8; }
.font-georgia { font-family: 'Georgia', serif; font-size: 18px; line-height: 1.75; }
.font-charter { font-family: 'Charter', 'Bitstream Charter', serif; font-size: 18px; line-height: 1.7; }

/* Footer */
.footer {
    padding: 18px 32px;
    border-top: 1px solid rgba(255,192,203,0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to top, rgba(255,251,252,0.7) 0%, rgba(255,255,255,0.5) 100%);
    backdrop-filter: blur(10px);
}

.status {
    font-size: 12px;
    color: #86868b;
    font-weight: 500;
}

.saved-indicator {
    opacity: 0;
    transition: opacity 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #ff8fa3;
    font-weight: 600;
}

.saved-indicator::before {
    content: '●';
    font-size: 8px;
    animation: pulse 1.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.saved-indicator.show {
    opacity: 1;
}

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

.entry-count {
    font-size: 12px;
    color: #86868b;
    padding: 4px 10px;
    background: rgba(255,192,203,0.1);
    border-radius: 8px;
    font-weight: 500;
}

.font-selector-trigger {
    font-size: 13px;
    color: #ff8fa3;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.font-selector-trigger:hover {
    background: rgba(255,192,203,0.15);
}

/* Font Picker Modal */
.font-picker {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.25s ease;
}

.font-picker.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.font-picker-box {
    background: linear-gradient(to bottom, #ffffff 0%, #fffbfc 100%);
    border-radius: 20px;
    padding: 28px;
    width: 420px;
    max-width: 90%;
    box-shadow: 0 30px 80px rgba(255,182,193,0.3), 0 0 0 1px rgba(250,235,240,0.5) inset;
    animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.font-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.font-picker-title {
    font-weight: 600;
    font-size: 17px;
    background: linear-gradient(135deg, #1d1d1f 0%, #ff9db5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.close-x {
    background: rgba(255,192,203,0.1);
    border: 1px solid rgba(255,192,203,0.2);
    font-size: 20px;
    cursor: pointer;
    color: #ff8fa3;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-x:hover {
    background: rgba(255,192,203,0.2);
    transform: rotate(90deg);
}

.font-grid {
    display: grid;
    gap: 10px;
}

.font-option {
    padding: 16px;
    border: 1.5px solid rgba(255,192,203,0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255,255,255,0.5);
}

.font-option:hover {
    border-color: rgba(255,192,203,0.5);
    background: rgba(255,251,252,0.8);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,192,203,0.15);
}

.font-option.active {
    border-color: #ff8fa3;
    background: linear-gradient(135deg, rgba(255,192,203,0.15) 0%, rgba(255,182,193,0.2) 100%);
    box-shadow: 0 4px 12px rgba(255,192,203,0.2);
}

.font-name {
    font-size: 12px;
    color: #86868b;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.font-preview {
    font-size: 16px;
    color: #1d1d1f;
}

/* Archive Panel */
.archive-panel {
    position: fixed;
    top: 0;
    right: -440px;
    width: 440px;
    height: 100vh;
    background: linear-gradient(to bottom, #ffffff 0%, #fffbfc 100%);
    box-shadow: -2px 0 40px rgba(255,182,193,0.2);
    padding: 0;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 50;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255,192,203,0.2);
}

.archive-panel.open {
    right: 0;
}

.archive-header {
    padding: 24px 28px;
    border-bottom: 1px solid rgba(255,192,203,0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(255,255,255,0.9) 0%, rgba(255,251,252,0.7) 100%);
    backdrop-filter: blur(10px);
}

.archive-title {
    font-weight: 600;
    font-size: 17px;
    background: linear-gradient(135deg, #1d1d1f 0%, #ff9db5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.entries-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.entries-list::-webkit-scrollbar {
    width: 10px;
}

.entries-list::-webkit-scrollbar-track {
    background: rgba(255,192,203,0.05);
}

.entries-list::-webkit-scrollbar-thumb {
    background: rgba(255,192,203,0.3);
    border-radius: 10px;
}

.entry-item {
    padding: 18px;
    margin-bottom: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255,192,203,0.15);
    background: rgba(255,255,255,0.5);
}

.entry-item:hover {
    background: rgba(255,251,252,0.9);
    border-color: rgba(255,192,203,0.35);
    transform: translateX(-4px);
    box-shadow: 0 4px 16px rgba(255,192,203,0.15);
}

.entry-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #1d1d1f;
    line-height: 1.4;
}

.entry-meta {
    font-size: 12px;
    color: #ff8fa3;
    font-weight: 500;
}

/* Entry View Modal */
.entry-view {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 60;
    padding: 20px;
}

.entry-view.show {
    display: flex;
}

.entry-view-box {
    background: linear-gradient(to bottom, #ffffff 0%, #fffbfc 100%);
    border-radius: 20px;
    padding: 36px;
    width: 640px;
    max-width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(255,182,193,0.35), 0 0 0 1px rgba(250,235,240,0.5) inset;
}

.entry-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,192,203,0.12);
}

.entry-view-date {
    font-size: 13px;
    background: linear-gradient(135deg, #86868b 0%, #ff9db5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
}

.entry-view-content {
    font-size: 17px;
    line-height: 1.7;
    color: #1d1d1f;
    white-space: pre-wrap;
}

/* Paywall Modal */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    z-index: 70;
}

.modal.show {
    display: flex;
}

.modal-box {
    background: linear-gradient(to bottom, #ffffff 0%, #fffbfc 100%);
    padding: 44px;
    border-radius: 24px;
    width: 480px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 40px 100px rgba(255,182,193,0.4), 0 0 0 1px rgba(250,235,240,0.5) inset;
    animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-box h2 {
    font-size: 26px;
    margin: 0 0 12px 0;
    font-weight: 600;
    background: linear-gradient(135deg, #1d1d1f 0%, #ff8fa3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-box p {
    color: #86868b;
    line-height: 1.6;
    margin: 0 0 24px 0;
    font-size: 15px;
}

.unlock-btn {
    background: linear-gradient(135deg, #ff8fa3 0%, #ffb6c1 100%);
    color: #fff;
    border: none;
    padding: 16px 32px;
    font-size: 16px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(255,143,163,0.3);
}

.unlock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(255,143,163,0.4);
}

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

.close-modal-btn {
    background: none;
    color: #86868b;
    border: none;
    padding: 12px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s ease;
}

.close-modal-btn:hover {
    color: #ff8fa3;
}

.price-tag {
    font-size: 42px;
    font-weight: 700;
    margin: 24px 0;
    background: linear-gradient(135deg, #ff8fa3 0%, #ffb6c1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.founding-badge {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(255,192,203,0.2) 0%, rgba(255,182,193,0.25) 100%);
    border: 1px solid rgba(255,192,203,0.3);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #ff8fa3;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Keyboard shortcut hint */
.shortcut-hint {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: linear-gradient(135deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.75) 100%);
    color: white;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(10px);
    font-family: 'SF Mono', 'Menlo', monospace;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,192,203,0.2) inset;
}

.shortcut-hint.show {
    opacity: 1;
}

/* Empty state */
.empty-state {
    padding: 60px 20px;
    text-align: center;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state-text {
    color: #86868b;
    font-size: 14px;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .journal-window {
        border-radius: 16px;
        height: 90vh;
    }
    
    .archive-panel {
        width: 100%;
        right: -100%;
    }
    
    .font-picker-box {
        width: 340px;
    }
}
