/* Shared UI Components */
/* Common elements used across multiple modules */

/* ==================== BUTTONS ==================== */

/* Primary action buttons (green accent) */
button,
.btn-primary,
.add-btn,
.annual-goals-add-btn,
.stickynotes-add-btn,
.routine-add-entry,
.kanban-add-task,
.submit {
    background: var(--color-buttons);
    color: var(--color-background);
    border: none;
    border-radius: 6px;
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 8px var(--color-buttons)99;
    transition: background 0.2s, color 0.2s;
    min-height: 44px;
}

button:hover,
.btn-primary:hover,
.add-btn:hover {
    background: var(--color-accent);
    color: var(--color-background);
    filter: brightness(0.9);
}

/* Secondary buttons */
.btn-secondary,
.modal-btn-secondary {
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-secondary:hover,
.modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-accent);
}

/* Small action buttons */
.btn-small {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    min-height: auto;
}

/* Icon-only buttons */
.btn-icon {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* ==================== INPUTS ==================== */

/* Text inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
    padding: 0.7rem;
    border: 1px solid var(--color-accent);
    border-radius: 6px;
    background: var(--color-widget);
    color: var(--color-text);
    font-size: 1rem;
    transition: border 0.2s;
    font-family: 'JetBrains Mono', 'Fira Mono', 'Consolas', 'Menlo', monospace;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #fff;
    outline: none;
    box-shadow: 0 0 8px var(--color-accent);
}

/* Large form inputs (for main forms) */
.input-large {
    background: var(--color-widget);
    color: var(--color-text);
    border: 2px solid var(--color-accent);
    box-shadow: 0 0 8px var(--color-accent);
    border-radius: 8px;
    font-size: 1.15rem;
    font-weight: bold;
    padding: 1rem 1.2rem;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
}

.input-large:focus {
    border: 2.5px solid #fff;
    box-shadow: 0 0 16px var(--color-accent)cc;
    background: var(--color-widget);
}

/* ==================== PROGRESS BARS ==================== */

.progress-bar,
.annual-goal-progress-bar,
.routine-progress-bar {
    background: var(--color-widget);
    border-radius: 8px;
    height: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--color-accent);
}

.progress-fill,
.annual-goal-progress-fill,
.routine-progress-fill {
    background: linear-gradient(90deg, var(--color-accent), var(--color-buttons));
    height: 100%;
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    50% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

.progress-text {
    font-size: 0.9rem;
    color: var(--color-accent);
    font-weight: bold;
    text-align: center;
}

/* ==================== CARDS ==================== */

.card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 1.2rem;
    color: var(--color-text);
    transition: border 0.3s, box-shadow 0.3s, transform 0.2s;
}

.card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ==================== FORMS ==================== */

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-text);
    font-weight: 500;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* ==================== UTILITY CLASSES ==================== */

.text-accent {
    color: var(--color-accent);
}

.text-muted {
    opacity: 0.7;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-1 {
    gap: 1rem;
}

/* Card containers need position:relative for absolutely-positioned action menus */
.kanban-task-card,
.personal-record-card,
.rule-principle-card,
.time-since-card,
.stickynote-card,
.annual-goal-card,
.sub-goal-card,
.card {
    position: relative;
}

/* Helper to lift a card above its siblings (used for menus) */
.z-elevated {
    z-index: 10 !important;
}

/* ==================== ENTRY OPTIONS (Three-Dot Menu) ==================== */

/* Three-dot menu button container - positioned in top-right of cards */
.entry-options {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Three-dot menu button */
.entry-options-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: var(--color-text);
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.2s;
    min-height: auto;
    width: 25px;
    height: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.entry-options-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--color-accent);
    box-shadow: 0 0 8px var(--color-accent)66;
}

/* Dropdown menu */
.entry-options-menu,
.actions-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.3rem;
    background: var(--color-widget);
    border: 1px solid var(--color-accent);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 8px var(--color-accent)66;
    min-width: 120px;
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.entry-options-menu.show,
.actions-dropdown.show {
    display: flex;
}

.entry-options-menu button,
.actions-dropdown button {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text);
    padding: 0.6rem 1rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
    width: 100%;
    min-height: auto;
    display: block;
}

.entry-options-menu button:last-child,
.actions-dropdown button:last-child {
    border-bottom: none;
}

.entry-options-menu button:hover,
.actions-dropdown button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-accent);
    box-shadow: none;
}

/* Show options on hover for desktop */
.kanban-task-card:hover .entry-options,
.personal-record-card:hover .entry-options,
.rule-principle-card:hover .entry-options,
.time-since-card:hover .entry-options,
.stickynote-card:hover .entry-options,
.annual-goal-card:hover .entry-options,
.sub-goal-card:hover .entry-options,
.card:hover .entry-options {
    opacity: 1;
}

/* Always show options on mobile */
@media (max-width: 900px) {

    .entry-options {
        opacity: 1;
    }
}

/* ==================== SECTIONS ==================== */

section {
    display: none;
}

section h2 {
    color: var(--color-title);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

#dashboard-section {
    display: block;
}
/* Keyboard focus visibility for sidebar navigation */
.sidebar-menu li:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: -2px;
}
