/* ==========================================================================
   TableLookup Common Styles
   Shared styles for all TableLookup management pages
   ========================================================================== */

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Page Header Styles */
.tl-page-header {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out;
}

.tl-page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(255,255,255,0.03) 10px,
            rgba(255,255,255,0.03) 20px
        );
    pointer-events: none;
}

.tl-header-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.tl-header-title-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tl-header-icon {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tl-header-icon .mud-icon-root {
    color: white;
    font-size: 32px;
}

.tl-header-text h1 {
    color: white;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 4px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tl-header-text p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin: 0;
}

.tl-stat-badge {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.6s ease-out 0.2s backwards;
}

.tl-stat-icon {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tl-stat-icon .mud-icon-root {
    color: white;
    font-size: 24px;
}

.tl-stat-content h3 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.tl-stat-content p {
    font-size: 12px;
    color: #666;
    margin: 0;
}

/* Action Section */
.tl-action-section {
    margin-top: 16px;
    margin-bottom: 24px;
    animation: fadeIn 0.6s ease-out 0.1s backwards;
}

.tl-add-button {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
    border-radius: 10px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
    transition: all 0.3s ease !important;
}

.tl-add-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4) !important;
}

.tl-back-button {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%) !important;
    color: white !important;
    border-radius: 10px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3) !important;
    transition: all 0.3s ease !important;
}

.tl-back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 114, 128, 0.4) !important;
}

/* Form Card */
.tl-form-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(25, 118, 210, 0.1);
    animation: slideIn 0.4s ease-out;
}

.tl-form-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.tl-form-header-icon {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tl-form-header-icon .mud-icon-root {
    color: white;
    font-size: 24px;
}

.tl-form-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

/* Field Label */
.tl-field-group {
    margin-bottom: 16px;
}

.tl-field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.tl-field-label-icon {
    color: #1976d2;
    font-size: 18px;
}

.tl-required-mark {
    color: #f44336;
    margin-left: 2px;
}

/* Data Table */
.tl-data-table {
    animation: fadeIn 0.6s ease-out;
}

.tl-search-input .mud-input-root {
    border-radius: 20px !important;
}

/* Status Chips */
.chip-active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    padding: 4px 12px !important;
}

.chip-inactive {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    padding: 4px 12px !important;
}

/* Buttons */
.tl-btn-primary {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%) !important;
    color: white !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.tl-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.4) !important;
}

.tl-btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
    color: white !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.tl-btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.4) !important;
}

.tl-btn-default {
    border: 2px solid #ddd !important;
    color: #666 !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.tl-btn-default:hover:not(:disabled) {
    border-color: #667eea !important;
    color: #667eea !important;
}

/* Loading Overlay */
.tl-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

.tl-loading-content {
    text-align: center;
}

.tl-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(25, 118, 210, 0.2);
    border-top-color: #1976d2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.tl-loading-text {
    margin-top: 16px;
    color: #1976d2;
    font-weight: 600;
}

/* Radio Group Container (for OkrOption style pages) */
.tl-radio-group-container {
    background: #f8f9fa;
    border: 2px solid rgba(25, 118, 210, 0.2);
    border-radius: 12px;
    padding: 16px;
}

.tl-radio-group-container .mud-radio {
    margin-bottom: 8px;
}

/* Switch Container (for CwieOption style pages) */
.tl-switch-container {
    background: #f8f9fa;
    border: 2px solid rgba(25, 118, 210, 0.2);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Level Section (for QualityAssurance hierarchical style) */
.tl-level-section {
    background: linear-gradient(135deg, #e0f2ff 0%, #f0f9ff 100%);
    border: 2px solid rgba(25, 118, 210, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.tl-level-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 16px;
    color: #1976d2;
    margin-bottom: 16px;
}

.tl-level-title .mud-icon-root {
    font-size: 20px;
}

/* Responsive Design */
@media (max-width: 960px) {
    .tl-header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .tl-stat-badge {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 600px) {
    .tl-page-header {
        padding: 16px;
    }

    .tl-header-text h1 {
        font-size: 20px;
    }

    .tl-form-card {
        padding: 16px;
    }
}

/* Utility Classes */
.tl-mt-1 { margin-top: 8px; }
.tl-mt-2 { margin-top: 16px; }
.tl-mt-3 { margin-top: 24px; }
.tl-mb-1 { margin-bottom: 8px; }
.tl-mb-2 { margin-bottom: 16px; }
.tl-mb-3 { margin-bottom: 24px; }
.tl-gap-1 { gap: 8px; }
.tl-gap-2 { gap: 16px; }
.tl-gap-3 { gap: 24px; }
