/**
 * Page Assembler Component Styles
 * Styles for all rendered components
 */

/* ============ Base Styles ============ */
* {
    box-sizing: border-box;
}

.component-wrapper {
    margin-bottom: 24px;
}

/* ============ Page Header ============ */
.page-header-component {
    margin-bottom: 24px;
}

.page-header-component .breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #64748b;
}

.page-header-component .breadcrumb-sep {
    color: #cbd5e1;
}

.page-header-component .header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.page-header-component h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.page-header-component .subtitle {
    color: #64748b;
    margin: 4px 0 0;
    font-size: 14px;
}

.page-header-component .header-actions {
    display: flex;
    gap: 8px;
}

/* ============ Buttons ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

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

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
}

/* ============ Stats Row ============ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card-primary .stat-icon {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.stat-card-success .stat-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.stat-card-warning .stat-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-card-danger .stat-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.stat-card-info .stat-icon {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
}

.stat-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 4px 0;
}

.stat-trend {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-trend.trend-up {
    color: #10b981;
}

.stat-trend.trend-down {
    color: #ef4444;
}

/* ============ Action Bar ============ */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.action-bar-left,
.action-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.search-box input {
    padding: 10px 12px 10px 38px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    width: 280px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ============ Filter Panel ============ */
.filter-panel {
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 500;
    color: #475569;
}

.filter-header i {
    margin-right: 8px;
}

.btn-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    transition: transform 0.3s;
}

.filter-panel.collapsed .btn-toggle {
    transform: rotate(-90deg);
}

.filter-body {
    padding: 0 20px 20px;
    border-top: 1px solid #e2e8f0;
    transition: max-height 0.3s, padding 0.3s;
}

.filter-panel.collapsed .filter-body {
    max-height: 0;
    padding: 0 20px;
    overflow: hidden;
    border: none;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding-top: 20px;
}

.filter-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
}

.filter-field input,
.filter-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

.filter-field input:focus,
.filter-field select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* ============ Data Table ============ */
.data-table-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table th.sortable:hover {
    background: #f1f5f9;
}

.data-table th i {
    margin-left: 6px;
    font-size: 11px;
    color: #94a3b8;
}

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

.data-table .empty-row td {
    text-align: center;
    padding: 40px;
}

.empty-message {
    color: #94a3b8;
    font-size: 14px;
}

.table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.pagination-info {
    font-size: 13px;
    color: #64748b;
}

.pagination-controls {
    display: flex;
    gap: 8px;
}

.btn-page {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    color: #475569;
}

.btn-page:hover:not(:disabled) {
    background: #f1f5f9;
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============ Chart ============ */
.chart-wrapper {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.chart-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.chart-container {
    height: 300px;
    position: relative;
}

/* ============ Activity Feed ============ */
.activity-feed {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.feed-header {
    margin-bottom: 16px;
}

.feed-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feed-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.feed-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    flex-shrink: 0;
}

.feed-content {
    flex: 1;
}

.feed-text {
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 4px;
}

.feed-time {
    font-size: 12px;
    color: #94a3b8;
}

.empty-feed {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
}

/* ============ Kanban Board ============ */
.kanban-board {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
}

.kanban-column {
    flex: 0 0 300px;
    background: #f1f5f9;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
}

.column-header {
    padding: 16px;
    border-top: 3px solid #6366f1;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.column-title {
    font-weight: 600;
    color: #1e293b;
}

.column-count {
    background: #e2e8f0;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 10px;
}

.column-cards {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kanban-card {
    background: white;
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: grab;
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card-title {
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 8px;
}

.kanban-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
}

/* ============ Modal ============ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
}

.modal-dialog {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    cursor: pointer;
    color: #64748b;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #e2e8f0;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* Modal Form */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field.field-full {
    grid-column: span 2;
}

.form-field.field-half {
    grid-column: span 1;
}

.form-field label {
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 6px;
}

.form-field .required {
    color: #ef4444;
}

.form-field input,
.form-field select,
.form-field textarea {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-field textarea {
    resize: vertical;
    min-height: 80px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
}

/* Confirm Modal */
.confirm-message {
    text-align: center;
    padding: 20px 0;
}

.confirm-message i {
    font-size: 48px;
    color: #f59e0b;
    margin-bottom: 16px;
}

.confirm-message p {
    font-size: 16px;
    color: #475569;
    margin: 0;
}

/* ============ Empty State ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.empty-state i {
    font-size: 64px;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px;
}

.empty-state p {
    color: #64748b;
    margin: 0 0 24px;
}

/* ============ Badge ============ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.badge-info {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

/* ============ Unknown Component ============ */
.unknown-component {
    padding: 20px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    color: #92400e;
    text-align: center;
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

    .action-bar {
        flex-direction: column;
        gap: 12px;
    }

    .search-box input {
        width: 100%;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

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

    .form-field.field-half,
    .form-field.field-full {
        grid-column: span 1;
    }

    .kanban-column {
        flex: 0 0 280px;
    }
}
