/* /public/css/menu/manage.css */

* {
    box-sizing: border-box;
}

body {
    background-color: #050c1d;
    overflow-x: hidden;
}

.manage-container {
    padding: 2rem 1rem;
    padding-top: 0;
    max-width: 1200px;
    margin: 0 auto;
    background-color: #050c1d;
    min-height: 100vh;
}

.manage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.manage-header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    text-align: center;
    margin: 0;
    color: #ffffff;
}

.manage-actions {
    display: flex;
    gap: 0.5rem;
}

/* Table Styling */
.menu-table {
    width: 100%;
    border-collapse: collapse;
    background: #1e293b;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.menu-table thead {
    background: #0f172a;
}

.menu-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.menu-table td {
    padding: 1rem;
    border-top: 1px solid #334155;
    color: #e2e8f0;
    vertical-align: middle;
}

.menu-table tbody tr:hover {
    background: #334155;
}

.parent-row { background: transparent; }
.child-row { background: rgba(15, 23, 42, 0.3); }

.drag-handle {
    cursor: grab;
    color: #94a3b8;
    font-size: 1.2rem;
    text-align: center;
    user-select: none;
}

.drag-handle:active { cursor: grabbing; }

/* Tags & Pills */
.permission-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    text-transform: uppercase;
}

.tag-guest { background-color: #64748b; color: #fff; }
.tag-user { background-color: #10b981; color: #fff; }
.tag-family { background-color: #a855f7; color: #fff; }
.tag-admin { background-color: #3b82f6; color: #fff; }

.status-pill {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

.status-pill.active { background-color: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid #10b981; }
.status-pill.inactive { background-color: rgba(148, 163, 184, 0.2); color: #94a3b8; border: 1px solid #94a3b8; }

/* Button Styling */
.btn-primary, .btn-secondary, .btn-danger, .btn-success {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary { background: #3b82f6; color: #fff; }
.btn-primary:hover { background: #2563eb; }

.btn-secondary { background: #334155; color: #e2e8f0; }
.btn-secondary:hover { background: #475569; }

.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-success { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; }

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #1e293b;
    padding: 2rem;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 600px;
    border: 1px solid #334155;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    margin-top: 0;
    color: #ffffff;
    margin-bottom: 1.5rem;
    font-weight: 300;
    font-size: 1.75rem;
}

.close {
    float: right;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: #94a3b8;
}

.close:hover { color: #ffffff; }

/* Form Controls */
.form-group { margin-bottom: 1.5rem; }

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 0.75rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    color: #e2e8f0;
    font-size: 1rem;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #3b82f6;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    color: #e2e8f0;
}

.checkbox-group input {
    width: 1.2rem;
    height: 1.2rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #334155;
}

.manage-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #334155;
}

.hint-text {
    font-size: 0.875rem;
    color: #94a3b8;
}

.separator-label {
    color: #64748b;
    font-family: monospace;
    font-weight: bold;
    letter-spacing: 2px;
}

/* SortableJS placeholder */
.sortable-ghost {
    opacity: 0.4;
    background-color: #334155;
}

/* Responsive */
@media (max-width: 768px) {
    .manage-container {
        padding: 0.5rem;
        padding-top: 0;
        background-color: #0f172a;
    }
    
    .manage-header {
        flex-direction: column;
        margin-bottom: 1.5rem;
        gap: 1rem;
    }

    .manage-header h1 {
        font-size: 1.5rem;
    }

    .menu-table thead {
        display: none;
    }
    
    .menu-table, .menu-table tbody {
        display: block;
        background: transparent;
        box-shadow: none;
    }

    .menu-table tr {
        display: block;
        background: #1e293b;
        border-radius: 0.75rem;
        margin-bottom: 0.75rem;
        padding: 1rem;
        border: 1px solid #334155;
        position: relative;
    }

    .menu-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        font-size: 0.875rem;
    }

    .menu-table td:not(.drag-handle):not(.actions-cell)::before {
        content: attr(data-label);
        font-weight: 600;
        color: #94a3b8;
        text-transform: uppercase;
        font-size: 0.75rem;
    }

    .drag-handle {
        position: absolute;
        right: 1rem;
        top: 1rem;
    }

    .actions-cell {
        margin-top: 0.5rem;
        padding-top: 0.75rem !important;
        border-top: 1px solid #334155 !important;
        justify-content: flex-end !important;
    }

    .child-row {
        margin-left: 1rem;
        width: calc(100% - 1rem);
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .modal-content {
        padding: 1.5rem;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .form-actions button {
        width: 100%;
    }
}
