/* ============================================================
   My Notes App – Frontend Styles
   ============================================================ */

/* ---------- Reset & Container ---------- */
.mna-app-container {
    max-width: 860px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

/* ---------- Header ---------- */
.mna-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.mna-header-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.mna-header-left h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.mna-logo {
    width: 28px;
    height: 28px;
    stroke: #fff;
}

.mna-user-greeting {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ---------- Controls ---------- */
.mna-controls {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    padding: 1.25rem 1.75rem;
    background: #f8f9fb;
    border-bottom: 1px solid #e8ecf1;
    flex-wrap: wrap;
}

.mna-date-control label,
.mna-user-control label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #7c8ba1;
    margin-bottom: 0.4rem;
}

.mna-date-wrapper {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.mna-date-input {
    width: 150px;
    padding: 0.55rem 0.8rem;
    border: 1px solid #d4dae3;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    background: #fff;
    color: #2d3748;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mna-date-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.mna-date-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #d4dae3;
    border-radius: 8px;
    background: #fff;
    font-size: 1.3rem;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.15s;
}

.mna-date-nav:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.mna-today-btn {
    padding: 0.5rem 0.85rem;
    border: 1px solid #d4dae3;
    border-radius: 8px;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    color: #667eea;
    cursor: pointer;
    transition: all 0.15s;
}

.mna-today-btn:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.mna-user-select {
    padding: 0.55rem 0.8rem;
    border: 1px solid #d4dae3;
    border-radius: 8px;
    font-size: 0.92rem;
    background: #fff;
    color: #2d3748;
    min-width: 200px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mna-user-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* ---------- Editor ---------- */
.mna-editor-wrapper {
    padding: 0 1.75rem;
    padding-top: 1.25rem;
}

#mna-editor {
    min-height: 350px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    line-height: 1.7;
    background: #fff;
}

/* Quill overrides */
#mna-editor .ql-editor {
    min-height: 300px;
    padding: 1.25rem 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.75;
    color: #2d3748;
}

#mna-editor .ql-editor.ql-blank::before {
    color: #a0aec0;
    font-style: italic;
}

.mna-editor-wrapper .ql-toolbar {
    border: 1px solid #e2e8f0;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    background: #f8f9fb;
}

.mna-editor-wrapper .ql-container {
    border: 1px solid #e2e8f0;
    border-radius: 0 0 10px 10px;
}

.mna-editor-wrapper .ql-toolbar .ql-stroke {
    stroke: #4a5568;
}

.mna-editor-wrapper .ql-toolbar .ql-fill {
    fill: #4a5568;
}

.mna-editor-wrapper .ql-toolbar button:hover .ql-stroke {
    stroke: #667eea;
}

.mna-editor-wrapper .ql-toolbar button:hover .ql-fill {
    fill: #667eea;
}

.mna-editor-wrapper .ql-toolbar button.ql-active .ql-stroke {
    stroke: #667eea;
}

.mna-editor-wrapper .ql-toolbar button.ql-active .ql-fill {
    fill: #667eea;
}

/* ---------- Footer ---------- */
.mna-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.75rem 1.5rem;
}

.mna-status {
    font-size: 0.85rem;
    color: #7c8ba1;
    min-height: 1.2em;
    transition: opacity 0.3s;
}

.mna-status.mna-status-success {
    color: #38a169;
    font-weight: 500;
}

.mna-status.mna-status-error {
    color: #e53e3e;
    font-weight: 500;
}

.mna-status.mna-status-saving {
    color: #667eea;
}

.mna-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.mna-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

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

.mna-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ---------- Login Prompt ---------- */
.mna-login-prompt {
    display: flex;
    justify-content: center;
    padding: 3rem 1rem;
}

.mna-login-card {
    text-align: center;
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem 3rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    max-width: 400px;
}

.mna-lock-icon {
    width: 48px;
    height: 48px;
    color: #667eea;
    margin-bottom: 1rem;
}

.mna-login-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    color: #2d3748;
}

.mna-login-card p {
    color: #718096;
    margin-bottom: 1.5rem;
}

.mna-login-btn {
    display: inline-block;
    padding: 0.7rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.mna-login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    color: #fff;
    text-decoration: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .mna-app-container {
        margin: 0.75rem;
        border-radius: 12px;
    }

    .mna-header {
        padding: 1rem 1.25rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .mna-controls {
        padding: 1rem 1.25rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .mna-editor-wrapper {
        padding: 0 1rem;
        padding-top: 1rem;
    }

    .mna-footer {
        padding: 1rem 1.25rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .mna-save-btn {
        width: 100%;
        justify-content: center;
    }

    .mna-user-select {
        min-width: unset;
        width: 100%;
    }
}
