/* Dashboard Styles - Restored from Original */
.action-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 850px;
    margin-bottom: 25px;
}

.dash-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 20px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.dash-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.playbook-fab {
    position: fixed;
    right: 40px;
    bottom: 120px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    cursor: pointer;
    z-index: 1200;
    box-shadow: 0 6px 16px rgba(255, 50, 50, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

.playbook-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 24px rgba(255, 50, 50, 0.5);
}

.project-list {
    width: 100%;
    max-width: 850px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-top: 20px;
    /* Removed margin-top as body already has padding-top for header offset in SPA mode */
}

.project-card {
    position: relative;
    z-index: 1;
    background-color: #1a0505;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid rgba(255, 100, 100, 0.2);
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.p-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.drag-handle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 18px;
    cursor: grab;
    opacity: 0;
    z-index: 4;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0));
    transition: opacity 0.2s ease;
    user-select: none;
}

.project-card:hover .drag-handle,
.project-card:active .drag-handle {
    opacity: 0.7;
}

.sortable-ghost {
    opacity: 0.4;
    background: var(--accent) !important;
    border: 2px dashed #fff !important;
}

.sortable-fallback {
    opacity: 0.85 !important;
    background-color: rgba(45, 10, 10, 0.9) !important;
    border: 2px dashed var(--accent) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    cursor: grabbing !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    z-index: 9999 !important;
    pointer-events: none !important;
    position: fixed !important;
    width: var(--drag-width, auto) !important;
    height: var(--drag-height, auto) !important;
    padding-top: 0 !important;
}

body.sorting,
body.sorting * {
    cursor: grabbing !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

body.sorting .project-card {
    transition: none !important;
}

@media (hover: none) {
    .drag-handle {
        opacity: 0.6;
    }

    .sortable-fallback {
        position: absolute !important;
    }
}

.p-row-top {
    padding-right: 70px;
}

.actions {
    position: absolute;
    top: 10px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(10, 1, 1, 0.4), var(--bg-dark));
    z-index: 2;
    opacity: 0.8;
}

.project-card>*:not(.p-card-bg) {
    position: relative;
    z-index: 3;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(255, 50, 50, 0.15);
    border-color: var(--accent);
}


.p-card-hint {
    position: absolute;
    bottom: 15px;
    left: 20px;
    font-size: 0.8rem;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.5s ease 1s;
    pointer-events: none;
    background: rgba(10, 1, 1, 0.7);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    letter-spacing: 1px;
    font-weight: 500;
    z-index: 2;
}

.project-card:hover .p-card-hint {
    opacity: 1;
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    color: white;
    transform: scale(1.1);
}

.inline-action {
    padding: 2px;
}

.official-ribbon {
    position: relative;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, rgba(255, 120, 120, 0.9), rgba(200, 40, 40, 0.95));
    box-shadow: 0 4px 10px rgba(255, 80, 80, 0.35);
}

.official-ribbon::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    margin: auto;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 6px solid rgba(200, 40, 40, 0.95);
}

.inline-title-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 8px;
    padding: 6px 10px;
    outline: none;
}

.status {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    background: rgba(255, 51, 51, 0.2);
    color: #ff5555;
}

.status.completed {
    display: none;
}

.progress-container {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    height: 6px;
    margin: 0;
}

.progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    transition: width 0.3s;
}

/* Edit / Share / Confirm Modals - Correct Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.modal-content {
    background: #1a0505;
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 25px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.edit-popup {
    position: absolute;
    background: rgba(20, 0, 0, 0.95);
    border: 1px solid var(--accent);
    padding: 8px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    gap: 8px;
    align-items: center;
}

.edit-popup input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    outline: none;
}

.btn-confirm-mini {
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
}

/* Background Player */
.bg-player-frame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
    display: none;
    z-index: 10000;
}

.bg-player-frame.active {
    display: block;
}

.bg-player-frame.minimized {
    display: block;
    visibility: hidden;
    pointer-events: none;
}

.player-fab {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--accent-gradient);
    border-radius: 50%;
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(255, 0, 0, 0.3);
}

#toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(50, 200, 50, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    z-index: 11000;
    display: none;
}


.p-card-title {
    font-size: 28px;
}

@media screen and (min-width: 851px) {
    .project-card .p-card-title,
    .project-card .p-card-meta,
    .project-card .p-row-bottom {
        opacity: 0.5;
        transition: opacity 0.2s;
    }

    .project-card:hover .p-card-title,
    .project-card:hover .p-card-meta,
    .project-card:hover .p-row-bottom {
        opacity: 1;
    }

    .p-card-title {
        font-size: 24px;
    }

    .p-card-meta,
    .p-row-bottom {
        font-size: 0.85rem;
    }
}

@media screen and (max-width: 850px) {
    .action-bar {
        flex-wrap: wrap;
    }

    .project-card {
        flex-wrap: wrap;
    }

    .p-row-top {
        flex-wrap: wrap;
        padding-right: 60px;
    }

    .actions {
        top: 8px;
        right: 12px;
    }

    .p-card-title {
        font-size: 20px !important;
    }

    .project-card,
    .project-card * {
        -webkit-user-select: none;
        user-select: none;
    }

    .project-card {
        touch-action: pan-y;
    }
}
