/* Memo page styles — match dashboard color scheme and be mobile-friendly */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --panel: #121212;
    --muted: rgba(255,255,255,0.65);
    --orange: #ff8a00;
    --bg: #0b0b0b;
    --danger: #ff6b6b;
}

html {
    background: linear-gradient(180deg, #060606 0%, #0f0f0f 100%);
    /* avoid fixed backgrounds on mobile (can cause rendering/scroll issues) */
    background-attachment: scroll;
    /* solid fallback color to avoid white gaps during overscroll */
    background-color: #0b0b0b;
    min-height: 100dvh;
    /* allow the page to scroll when content is taller than the viewport */
    overflow-y: auto;
    /* allow default overscroll behaviour rather than forcing none */
    overscroll-behavior: auto;
    touch-action: pan-y;
}

body {
    /* match html background to avoid white gaps on overscroll in desktop browsers */
    background: linear-gradient(180deg, #060606 0%, #0f0f0f 100%);
    background-attachment: scroll;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    /* allow the body itself to scroll on mobile browsers (fixes Chrome Mobile lock) */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* allow native overscroll behaviour */
    overscroll-behavior: auto;
    /* solid fallback color to avoid white gaps during overscroll */
    background-color: #0b0b0b;
    touch-action: pan-y;
    margin: 0;
    padding: 0;
}

main {
    flex: 1;
    /* make the main content area scrollable while keeping header/footer visible */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* ensure main can expand to viewport height on mobile using dynamic viewport units */
    min-height: calc(100dvh - 60px);
    /* give a small bottom padding so content doesn't sit flush against footer */
    padding-bottom: 20px;
    touch-action: pan-y;
}

/* Header Styles */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10000;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 32px;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.header-logo:hover {
    transform: scale(1.05);
}

.header-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Button Styles */
.btn-primary {
    background: var(--orange);
    color: #000;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary:hover {
    background: #ff9d1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,138,0,0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--orange);
    padding: 8px 16px;
    border-radius: 6px;
    border: 1.5px solid rgba(255,138,0,0.4);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: rgba(255,138,0,0.08);
    border-color: rgba(255,138,0,0.7);
    transform: translateY(-2px);
}

.btn-remove {
    background: transparent;
    color: var(--danger);
    padding: 8px 16px;
    border-radius: 6px;
    border: 1.5px solid rgba(255,107,107,0.4);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-remove:hover {
    background: rgba(255,107,107,0.08);
    border-color: rgba(255,107,107,0.7);
    transform: translateY(-2px);
}

.btn-cancel {
    background: transparent;
    color: var(--muted);
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    color: #fff;
}

/* Memo Card Styles */
.memo {
    background: var(--panel);
    border: 1px solid rgba(255,255,255,0.03);
    box-shadow: 0 4px 18px rgba(0,0,0,0.6);
    border-radius: 10px;
}

/* Profile Link Styles */
.profile-link-item {
    display: inline-block;
    margin: 4px 8px 4px 0;
    padding: 6px 12px;
    background: rgba(255,138,0,0.08);
    color: var(--orange);
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid rgba(255,138,0,0.2);
    transition: all 0.2s ease;
    font-size: 13px;
}

.profile-link-item:hover {
    background: rgba(255,138,0,0.15);
    border-color: rgba(255,138,0,0.4);
    transform: translateY(-2px);
}

/* Modal Styles */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10005;
}

.modal-backdrop.hidden {
    display: none;
    pointer-events: none;
}

.modal-backdrop.show {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-panel {
    background: linear-gradient(180deg, #0e0e0e 0%, #121212 100%);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 8px 32px rgba(0,0,0,0.8);
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
}

.modal-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    color: var(--orange);
    margin: 0;
    font-size: 18px;
}

.modal-body {
    padding: 16px;
    color: var(--muted);
    font-size: 14px;
}

.modal-body p {
    margin: 0 0 12px 0;
    line-height: 1.5;
}

/* Footer Styles */
.site-footer {
    padding: 20px 16px;
    text-align: center;
    color: var(--muted);
    border-top: 1px solid rgba(255,255,255,0.04);
    background: rgba(0,0,0,0.3);
    font-size: 13px;
    margin-top: auto;
}

.site-footer a {
    color: var(--orange);
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: #ff9d1a;
    text-decoration: underline;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-content p {
    margin-bottom: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .site-header {
        flex-wrap: wrap;
        padding: 12px;
        gap: 12px;
    }

    .header-logo {
        height: 32px;
    }

    .header-right {
        width: 100%;
        justify-content: flex-end;
    }

    .btn-primary,
    .btn-secondary,
    .btn-cancel {
        padding: 7px 12px;
        font-size: 13px;
    }

    .memo {
        padding: 14px;
    }

    .modal-panel {
        margin: 12px;
        width: calc(100% - 24px);
    }
}

@media (max-width: 480px) {
    main {
        padding: 12px;
        margin: 20px auto;
    }

    .site-header {
        padding: 10px;
        gap: 8px;
    }

    .header-logo {
        height: 28px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-cancel {
        padding: 6px 10px;
        font-size: 12px;
    }

    .memo {
        padding: 12px;
    }

    .modal-panel {
        margin: 16px;
        width: calc(100% - 32px);
    }

    .modal-header h3 {
        font-size: 16px;
    }

    .modal-body {
        font-size: 13px;
    }
}

