/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

body {
    font-family: var(--font-sans);
    padding: 0;
    line-height: 1.6;
    background: var(--color-bg);
    color: var(--color-text);
    margin: 0;
}

/* Prevent background scrolling when popups or panels are open */
.no-scroll {
    overflow: hidden !important;
    height: 100%;
}

nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 0.875em;
    gap: 0.2rem;
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem;
    background: var(--color-nav-bg);
    border-bottom: 1px solid var(--color-border);
}

nav a,
nav button{
    min-width: 2em;
    line-height: 2.1;
    font-size: 1.125em;
    background: var(--color-bg);
    color: var(--color-btn-text);
    text-decoration: none;
    padding: 0.25em 0.6em;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    transition: background 0.3s;
}

/* progress filter button group */
.progress-filter-group {
    display: flex;
}

.progress-filter-btn {
    border-radius: 0;
}

.progress-filter-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.progress-filter-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.progress-filter-btn + .progress-filter-btn {
    border-left: none;
}

.progress-filter-btn.active {
    background: var(--color-btn-bg);
}

.creative-actions-row a,
.creative-actions-row button {
    line-height: 1.2;
    font-size: 0.875em;
    background: var(--color-btn-bg);
    color: var(--color-btn-text);
    text-decoration: none;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 0.25em 0.6em;
    transition: background 0.2s;
}

nav a:hover,
nav button:hover,
.creative-actions-row a:hover,
.creative-actions-row button:hover {
    filter: brightness(var(--hover-brightness));
}

#search {
    line-height: 2.1;
    font-size: 1.125em;
    background: var(--color-bg);
    color: var(--color-btn-text);
    padding:0.3em; border-radius:4px; border:1px solid var(--color-border);
}

input[type="text"],
input[type="number"],
input[type="url"],
input[type="date"],
textarea {
    background: var(--color-bg);
    color: var(--color-btn-text);
    padding: 0.3em;
    border-radius: 4px;
    border: 1px solid var(--color-border);
}

main {
    max-width: 960px;
    margin: 0rem auto;
    padding: 0 1rem;
    background: var(--color-section-bg);
}

@media (max-width: 768px) {
    main {
        padding: 0 0.3rem;
    }
}

.notice {
    color: green;
}

.flash-alert {
    color: red;
}

section.creative {
    display: flex;
    gap: 1rem;
    flex-direction: row;
}

section.creative img {
    border-radius: 8px;
    flex-basis: 50%;
    max-width: 50%;
}

/* Remove link styling for all Creative links */
.unstyled-link {
    color: inherit;
    text-decoration: none;
}

.drag-over {
    background: var(--color-drag-over) !important;
    transition: background 0.15s;
}


.drag-over-top {
    border-top: 3px solid var(--color-drag-over-edge) !important;
}

.drag-over-bottom {
    border-bottom: 3px solid var(--color-drag-over-edge) !important;
}

button {
    cursor: pointer;
}

#plans-list-area {
    max-width: 960px;
    margin: 0.5em auto;
}

#plans-list-area hr {
    border: 0;
    border-top: 1px solid var(--color-border);
}

.timeline {
    position: relative;
    padding-left: 1.5em;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5em;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-border);
}

.timeline-date {
    font-weight: bold;
    margin: 0.5em 0 0.25em;
}

.timeline-item {
    position: relative;
    margin-bottom: 0.5em;
    padding-left: 1em;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -0.5em;
    top: 0.45em;
    width: 0.6em;
    height: 0.6em;
    background: var(--color-btn-bg);
    border-radius: 50%;
}

.horizontal-timeline {
    overflow-x: auto;
    position: relative;
    padding-bottom: 1em;
}

.plans-timeline-wrapper {
    position: relative;
}

.plans-timeline-wrapper #timeline-today-btn {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
}

.horizontal-timeline .timeline-scroll {
    position: relative;
    white-space: nowrap;
    height: 120px;
}

.horizontal-timeline .timeline-day {
    display: inline-block;
    width: 80px;
    box-sizing: border-box;
    border-right: 1px solid var(--color-border);
    text-align: center;
    font-size: 0.8em;
}

.plan-form-container {
    padding: 0.5em;
}

.plan-bar {
    position: absolute;
    height: 20px;
    background: var(--color-border);
    border-radius: 4px;
    overflow: hidden;
}

.plan-bar .plan-progress {
    background: var(--color-complete);
    height: 100%;
}

.plan-bar .plan-label {
    position: absolute;
    left: 2px;
    top: 2px;
    font-size: 0.75em;
    color: var(--color-text);
}

.plan-bar .delete-plan-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    border: none;
    background: none;
    font-weight: bold;
    cursor: pointer;
    color: var(--color-bg);
}


#inbox-panel.slide-panel {
    position: fixed;
    top: 0;
    right: -360px;
    width: 360px;
    max-width: 100vw;
    height: 100%;
    background: var(--color-section-bg);
    border-left: 1px solid var(--color-border);
    box-shadow: -2px 0 8px rgba(0,0,0,0.15);
    overflow-y: auto;
    transition: right 0.3s;
    z-index: 1000;
    border-radius: 8px 0 0 8px;
}

#inbox-panel.open {
    right: 0;
}

@media (max-width: 360px) {
    #inbox-panel.slide-panel {
        right: -100vw;
        width: 100vw;
    }
    #inbox-panel.slide-panel.open {
        right: 0;
    }
}

.inbox-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75em;
    background: var(--color-nav-bg);
    border-bottom: 1px solid var(--color-border);
}

#close-inbox {
    background: none;
    border: none;
    font-size: 1.2em;
    line-height: 1;
    cursor: pointer;
}

.inbox-item {
    border-bottom: 1px solid var(--color-border);
    padding: 0.75em;
}

.inbox-item:last-child {
    border-bottom: none;
}

.inbox-item .actions button {
    margin-right: 0.5em;
}

#inbox-menu-btn {
    position: relative;
}

#inbox-badge,
.badge {
    background: var(--color-badge-bg, red);
    color: var(--color-badge-text, white);
    border-radius: 10px;
    padding: 0 4px;
    font-size: 0.75em;
    line-height: 1.2;
    margin-left: 0;
    display: none;
}

/* Responsive visibility helpers */
.mobile-only {
    display: none;
}

.desktop-only {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    .mobile-only {
        display: inline-block !important;
    }
}

input[type="password"] {
    max-width: 80%;
}
