#roteiro-view {
    max-width: 1280px;
    margin: 0 auto var(--spacing-xl) auto;
    width: 100%;
    animation: fadeInUp 0.8s ease-out;
    transform: translateY(0px);
    opacity: 1;
    padding: 1rem;
    position: relative;
    box-sizing: border-box;

    .logo-container-roteiro {
        padding: 5px;
    }

    .title-roteiro {
        font-size: var(--font-size-3xl);
        font-weight: 600;
        color: var(--text-main);
        position: relative;
        margin: 0;
    }

    .roteiro-header {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        margin-bottom: 2rem;
        align-items: center;
    }

    .roteiro-info {
        display: flex;
        flex-direction: column;
    }

    .roteiro-descricao {
        font-size: var(--font-size-md);
        color: var(--text-dark);
        line-height: 1.5;

        legend {
            margin-top: 20px;
            font-size: 14px;
            color: #777;
        }
    }

    .roteiro-imagem {
        display: flex;
        justify-content: flex-end;
        align-items: center;

        img {
            max-width: 300px;
            height: auto;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }
    }

    .error-message {
        margin: 2rem 0;
        padding: 1.5rem;
        background-color: #fff0f0;
        border-radius: 8px;
        border-left: 4px solid #ff3333;
        color: #ff3333;
        width: 100%;
    }

    /* Sequencia wrapper styles */

    .sequencia-wrapper {
        margin-top: 2rem;
        width: 100%;
        border: 1px solid #e0e0e0;
        border-radius: 10px;
        padding: 1.5rem;
        background: #f9f9f9;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

        h3 {
            font-size: 20px;
            font-weight: 600;
            color: var(--text-main);
            margin-bottom: 1rem;
        }
    }

    .drag-container {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .drag-item {
        display: grid;
        grid-template-columns: 40px 80px 1fr auto;
        align-items: center;
        background: #ffffff;
        padding: 0.75rem 1rem;
        margin-bottom: 0.8rem;
        border-radius: 8px;
        border: 1px solid #e0e0e0;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        transition: all 0.2s ease;
        cursor: pointer;
    }

    .drag-item.disabled {
        background: #f5f5f5;
        cursor: not-allowed;
        opacity: 0.8;
        position: relative;
    }

    .drag-item.disabled:hover::after {
        content: "É necessário concluir o item anterior para liberar esta etapa.";
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background-color: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 8px 12px;
        border-radius: 4px;
        font-size: 14px;
        white-space: nowrap;
        z-index: 1000;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }

    .drag-item.disabled .play-button {
        background-color: #cccccc;
        pointer-events: none;
        box-shadow: none;
    }

    .drag-item .capa {
        width: 80px;
        height: 48px;
        border-radius: 4px;
        object-fit: cover;
        margin-right: 10px;
        border: 1px solid #eee;
    }

    .drag-item .numero {
        font-weight: bold;
        background-color: #f0f0f0;
        border-radius: 50%;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 10px;
    }

    .drag-item .tipo {
        display: flex;
        align-items: center;
        font-size: 14px;
        font-weight: 400;
        margin-left: 10px;
        color: #aaa;
        text-transform: capitalize;
    }

    .drag-item .titulo {
        margin-left: 10px;
        font-weight: bold;
        flex-grow: 1;
    }

    .drag-item .play-button {
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: var(--color-primary);
        color: white;
        border-radius: 16px;
        width: auto;
        padding: 10px 20px;
        text-decoration: none;
        transition: all 0.3s ease;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }

    .drag-item .play-button:hover {
        background-color: var(--color-primary);
        transform: scale(1.1);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }

    .drag-item .play-button.play-active {
        background-color: #4CAF50;
        transform: scale(1.1);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }

    .drag-item .play-button.play-visited {
        background-color: #8bc34a;
        transform: scale(1.05);
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    }

    .drag-item .play-button .material-symbols-outlined {
        font-size: 20px;
    }

    .drag-item .completed-text {
        display: flex;
        align-items: center;
        justify-content: center;
        color: #4CAF50;
        font-weight: bold;
        font-size: 14px;
        text-transform: uppercase;
    }

    .drag-item .time-completed {
        display: flex;
        align-items: center;
        justify-content: center;
        color: #da6d6d;
        font-weight: bold;
        font-size: 14px;
        text-transform: uppercase;
        cursor: default;
    }

    .roteiro-data-criacao {
        width: fit-content;
        font-size: 0.9em;
        color: #666;
        margin-top: 20px;
        font-style: italic;
        background: #eee;
        border-radius: 16px;
        padding: 0.5rem 1rem;
    }
}

/* User Profile Styles - Material Design 3 */
.header-profile {
    display: flex;
    justify-content: space-between;
    width: 100%;
    border: 1px solid red;
}

.user-profile {
    /* position: absolute; */
    display: flex;
    justify-content: space-between;
    top: 1rem;
    right: 1rem;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border-radius: 16px;
    padding: 0.5rem 1rem;
    /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); */
    z-index: 10;
    /* border: 1px solid rgba(0, 0, 0, 0.08); */
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--color-primary);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-stats {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.user-coins, .user-stickers {
    display: flex;
    align-items: center;
    background: #f5f7fa;
    border-radius: 12px;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.icon-coins, .icon-stickers {
    width: 16px;
    height: 16px;
    margin-right: 0.3rem;
}

.coins-value, .stickers-value {
    font-weight: 700;
    color: #4c6faf;
    margin-right: 0.2rem;
}

.coins-label, .stickers-label {
    color: #666;
    font-size: 0.8rem;
}

/* Tablet styles */
@media (max-width: 992px) and (min-width: 769px) {
    .user-profile {
        position: relative;
        top: 0;
        right: 0;
        margin-bottom: 1rem;
        width: 100%;
    }

    #roteiro-view .roteiro-header {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    #roteiro-view .roteiro-imagem img {
        max-width: 250px;
    }

    #roteiro-view .drag-item {
        grid-template-columns: 40px 60px 1fr auto;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    .user-profile {
        position: relative;
        top: 0;
        right: 0;
        margin-bottom: 1rem;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem;
    }

    .user-info {
        width: 100%;
        justify-content: space-between;
        margin-bottom: 0.5rem;
    }

    .user-stats {
        width: 100%;
        justify-content: space-around;
    }
}

/* Responsive styles */
@media (max-width: 768px) {
    #roteiro-view {
        padding: 0.75rem;
    }

    #roteiro-view .title-roteiro {
        font-size: 1.5rem;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    #roteiro-view .roteiro-header {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    #roteiro-view .roteiro-info {
        text-align: center;
        gap: 0.75rem;
    }

    #roteiro-view .roteiro-descricao {
        font-size: 0.95rem;
    }

    #roteiro-view .roteiro-data-criacao {
        font-size: 0.8rem;
    }

    #roteiro-view .roteiro-imagem {
        justify-content: center;
        order: -1;
    }

    #roteiro-view .roteiro-imagem img {
        max-width: 100%;
        height: auto;
    }

    #roteiro-view .sequencia-wrapper {
        padding: 1rem;
    }

    #roteiro-view .drag-item {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        padding: 1rem;
        border-radius: 12px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        position: relative;
        margin-bottom: 1.2rem;
    }

    #roteiro-view .drag-item .numero {
        position: absolute;
        top: 10px;
        right: 10px;
        margin: 0;
        width: 30px;
        height: 30px;
        font-size: 1.1rem;
        background-color: rgba(76, 111, 175, 0.9);
        color: white;
        z-index: 5;
    }

    #roteiro-view .drag-item .capa {
        width: 100%;
        height: 140px;
        border-radius: 8px;
        margin: 0 0 12px 0;
        object-fit: cover;
        border: none;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    #roteiro-view .drag-item .tipo {
        margin: 0 0 4px 0;
        font-size: 14px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    #roteiro-view .drag-item .titulo {
        margin: 0 0 12px 0;
        font-size: 18px;
        width: 100%;
        text-align: left;
        line-height: 1.3;
    }

    #roteiro-view .drag-item .play-button {
        align-self: stretch;
        width: 100%;
        height: auto;
        margin-top: 12px;
        padding: 12px;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
    }

    #roteiro-view .drag-item .play-button .material-symbols-outlined {
        font-size: 24px;
    }

    #roteiro-view .drag-item .completed-text {
        font-size: 16px;
        margin-top: 8px;
        padding: 4px 8px;
        background-color: rgba(76, 175, 80, 0.1);
        border-radius: 4px;
    }

    /* Mobile tooltip adjustments */
    #roteiro-view .drag-item.disabled:hover::after {
        width: 90%;
        white-space: normal;
        text-align: center;
        bottom: auto;
        top: 100%;
        margin-top: 10px;
    }
}

/* Custom Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1050;
    overflow: auto;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex !important;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    max-width: 500px;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: #fff;
    border-radius: 0.3rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    outline: 0;

    li {
        padding: 4px;
        margin: 0 20px;
        list-style: circle;
    }

    .menu-icon {
        display: inline;
        padding: 2px 6px;
        border: 1px solid #ccc;
    }
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    border-top-left-radius: 0.3rem;
    border-top-right-radius: 0.3rem;
}

.modal-title {
    margin-bottom: 0;
    line-height: 1.5;
    font-size: 1.25rem;
    font-weight: 500;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem;
    border-top: 1px solid #e9ecef;
}

.close {
    float: right;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: .5;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.close:hover {
    color: #000;
    text-decoration: none;
    opacity: .75;
}

.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
}

.btn-primary {
    color: #fff;
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-primary:hover {
    color: #fff;
    background-color: #3f5d93;
    border-color: #3b578a;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    opacity: 0.5;
    z-index: 1040;
}

@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    #roteiro-view {
        padding: 0.5rem;
    }

    #roteiro-view .title-roteiro {
        font-size: 1.3rem;
    }

    #roteiro-view h1 {
        font-size: 1.5rem;
        text-align: center;
        margin: 1rem 0;
    }

    #roteiro-view .sequencia-wrapper h3 {
        font-size: 1.2rem;
        text-align: center;
    }

    #roteiro-view .drag-item {
        padding: 0.75rem;
    }

    #roteiro-view .drag-item .capa {
        height: 120px;
    }

    #roteiro-view .drag-item .titulo {
        font-size: 16px;
    }

    #roteiro-view .drag-item .play-button {
        padding: 10px;
        font-size: 14px;
    }

    .user-profile {
        padding: 0.5rem;
    }

    .user-avatar {
        width: 30px;
        height: 30px;
    }

    .user-name {
        font-size: 0.85rem;
    }

    .user-coins, .user-stickers {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }

    .coins-label, .stickers-label {
        font-size: 0.7rem;
    }
}