/* Moto360 - UI Components, Tables, Modals & Mobile Sheets */

/* Buttons System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1.4rem;
    min-height: var(--touch-target);
    font-size: var(--font-sm);
    font-weight: 700;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    line-height: 1;
}

.btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background-color: var(--accent-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
    background-color: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background-color: #ffffff;
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.btn-success {
    background-color: var(--color-emerald);
    color: #ffffff;
}

.btn-sm {
    padding: 0.45rem 0.9rem;
    min-height: 38px;
    font-size: var(--font-xs);
    border-radius: var(--radius-sm);
}

/* Modals & Mobile Drawers */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-overlay.active {
    display: flex;
    animation: modalFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFade {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.modal-container {
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 920px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.modal-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-surface-elevated);
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-title-group h3 {
    font-size: var(--font-xl);
    font-weight: 800;
    color: var(--text-primary);
}

.modal-close {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-red-bg);
    color: var(--color-red);
    border-color: var(--color-red);
}

.modal-body {
    padding: 1.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Modal Step Progress Tracker */
.order-progress-tracker {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
}

.order-progress-tracker::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 2.5rem;
    right: 2.5rem;
    height: 3px;
    background: var(--border-subtle);
    z-index: 1;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    z-index: 2;
    background: #ffffff;
    padding: 0 0.5rem;
}

.step-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-xs);
    font-weight: 800;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.step-item.active .step-dot {
    border-color: var(--accent-blue);
    background: var(--accent-blue);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.step-item.completed .step-dot {
    border-color: var(--color-emerald);
    background: var(--color-emerald);
    color: #ffffff;
}

.step-label {
    font-size: var(--font-xs);
    font-weight: 700;
    color: var(--text-muted);
}

.step-item.active .step-label {
    color: var(--accent-blue);
}

/* Modal Tabs */
.tab-header {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-subtle);
    padding-bottom: 2px;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    font-size: var(--font-sm);
    font-weight: 700;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.data-table th {
    background-color: var(--bg-surface-elevated);
    padding: 1rem 1.25rem;
    font-size: var(--font-xs);
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
}

.data-table td {
    padding: 1.1rem 1.25rem;
    font-size: var(--font-sm);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Mobile Responsive Modal & Sheet Adaptations */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal-container {
        max-height: 92vh;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .modal-header {
        padding: 1rem 1.25rem;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .order-progress-tracker {
        overflow-x: auto;
    }

    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
