/* ========================================
   Tableau Metadata Extractor - Main CSS
   ======================================== */

/* Color Variables */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --dark-bg: #2d3561;
    --light-bg: #f8f9fa;
    --text-muted: #6c757d;
    --gradient-start: #667eea;
    --gradient-end: #764ba2;
}

/* Body Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
}

/* ========================================
   Text Colors
   ======================================== */
.text-primary-custom {
    color: var(--primary-color) !important;
}

.text-secondary-custom {
    color: var(--secondary-color) !important;
}

.text-accent {
    color: var(--accent-color) !important;
}

/* ========================================
   Buttons
   ======================================== */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.btn-primary-custom:active {
    transform: translateY(0);
}

/* ========================================
   Icons
   ======================================== */
.icons-class-1 {
    color: var(--secondary-color);
    font-size: 24px;
    flex-shrink: 0;
}

.icons-class-2 {
    color: var(--accent-color);
    font-size: 20px;
    flex-shrink: 0;
}

.icons-class-2-size {
    font-size: 8px !important;
    margin-right: 4px;
}

/* Icon hover effects */
.card:hover .icons-class-1,
.card:hover .icons-class-2 {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* ========================================
   Cards
   ======================================== */
.card {
    border: none;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.card.shadow-lg {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* Disable hover animation for specific cards */
.card-no-hover:hover {
    transform: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Gradient Card */
.gradient-card {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    border: none;
}

.gradient-card .card-body {
    position: relative;
    z-index: 1;
}

.gradient-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gradient-card:hover::before {
    opacity: 1;
}

/* ========================================
   Hover Cards
   ======================================== */
.hover-card {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.hover-card:hover {
    background-color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateX(5px);
}

/* ========================================
   Dots / Bullet Points
   ======================================== */
.dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--primary-color);
    border-radius: 50%;
    margin-right: 8px;
}

/* List styling */
.list-unstyled li {
    position: relative;
    padding-left: 0;
}

/* ========================================
   Form Elements
   ======================================== */
.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 12px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.form-label {
    font-weight: 600;
    margin-bottom: 8px;
}

/* ========================================
   Navbar
   ======================================== */
.custom-navbar-bg {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #2d3561 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.navbar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.navbar .nav-link.nav-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.navbar .nav-link.nav-disabled:hover {
    background-color: transparent;
}

.navbar .nav-link.nav-enabled {
    opacity: 1;
}

.navbar .nav-link .fa-check-circle {
    font-size: 0.75rem;
    animation: pulse-check 2s ease-in-out infinite;
}

@keyframes pulse-check {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 0 4px;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ========================================
   Footer
   ======================================== */
.panel-footer {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #2d3561 100%);
    padding: 20px 0;
    margin-top: 60px;
    text-align: center;
}

#navbar_id {
    background: var(--dark-bg);
}

/* ========================================
   Background Utilities
   ======================================== */
.bg-light {
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef;
}

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

.card {
    animation: fadeIn 0.5s ease-out;
}

/* Stagger animation for multiple cards */
.col-lg-6:nth-child(1) .card {
    animation-delay: 0.1s;
}

.col-lg-6:nth-child(2) .card:nth-child(1) {
    animation-delay: 0.2s;
}

.col-lg-6:nth-child(2) .card:nth-child(2) {
    animation-delay: 0.3s;
}

.col-lg-6:nth-child(2) .card:nth-child(3) {
    animation-delay: 0.4s;
}

/* ========================================
   Responsive Styles
   ======================================== */
@media (max-width: 991px) {
    .col-lg-6 {
        margin-bottom: 20px;
    }
    
    .hover-card:hover {
        transform: translateX(0);
    }
}

@media (max-width: 576px) {
    .btn-primary-custom {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .h4 {
        font-size: 1.25rem;
    }
}

/* ========================================
   Utility Classes
   ======================================== */
.rounded {
    border-radius: 8px !important;
}

.shadow {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* ========================================
   SVG Icon Styling
   ======================================== */
svg.icon {
    transition: all 0.3s ease;
}

svg.icon:hover {
    transform: scale(1.1) rotate(5deg);
}

/* ========================================
   File Upload Styling
   ======================================== */
input[type="file"].form-control {
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

input[type="file"].form-control::file-selector-button {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.3s ease;
}

input[type="file"].form-control::file-selector-button:hover {
    background: linear-gradient(135deg, var(--gradient-end) 0%, var(--gradient-start) 100%);
    transform: scale(1.05);
}

/* ========================================
   DataTables Custom Styling
   ======================================== */
.dataTables_wrapper {
    padding: 20px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

/* Search bar styling */
.dataTables_filter {
    margin-bottom: 20px;
}

.dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--primary-color);
}

.dataTables_filter input {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-left: 8px;
    min-width: 250px;
}

.dataTables_filter input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

/* Length menu styling */
.dataTables_length {
    margin-bottom: 20px;
}

.dataTables_length label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #6c757d;
}

.dataTables_length select {
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    margin: 0 8px;
}

.dataTables_length select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

/* Table styling with rounded edges */
table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    table-layout: auto;
    width: 100% !important;
}

table.dataTable thead th {
    background: var(--dark-bg);
    color: white;
    font-weight: 600;
    padding: 16px 12px;
    border: none;
    text-align: left;
}

table.dataTable thead th:first-child {
    border-top-left-radius: 12px;
}

table.dataTable thead th:last-child {
    border-top-right-radius: 12px;
}

table.dataTable tbody td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 300px;
    overflow-wrap: break-word;
}

/* Specific styling for calculation column */
table.dataTable tbody td:last-child,
table.dataTable thead th:last-child {
    max-width: 400px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Calculation column formatting - only for metadataTable (field details) */
#metadataTable tbody td:last-child {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    background-color: #f8f9fa;
    padding: 10px;
    border-left: 3px solid var(--primary-color);
    line-height: 1.6;
}

table.dataTable tbody tr {
    transition: all 0.2s ease;
}

table.dataTable tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
    transform: scale(1.01);
}

table.dataTable tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

table.dataTable tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

/* Pagination styling */
.dataTables_paginate {
    margin-top: 20px;
}

.dataTables_paginate .paginate_button {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 8px 14px;
    margin: 0 4px;
    background-color: white;
    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.dataTables_paginate .paginate_button:hover {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
    border-color: var(--gradient-start);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
    border-color: var(--gradient-start);
}

.dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dataTables_paginate .paginate_button.disabled:hover {
    background-color: white;
    color: var(--primary-color);
    transform: none;
    box-shadow: none;
}

/* Info text styling */
.dataTables_info {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

/* Export buttons styling */
.dt-buttons {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-export {
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.excel-btn {
    background: linear-gradient(135deg, #217346 0%, #2d9e5f 100%);
    color: white;
}

.excel-btn:hover {
    background: linear-gradient(135deg, #2d9e5f 0%, #217346 100%);
    color: white;
}

.csv-btn {
    background: linear-gradient(135deg, #0077be 0%, #00a0e9 100%);
    color: white;
}

.csv-btn:hover {
    background: linear-gradient(135deg, #00a0e9 0%, #0077be 100%);
    color: white;
}

.pdf-btn {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    color: white;
}

.pdf-btn:hover {
    background: linear-gradient(135deg, #e74c3c 0%, #dc3545 100%);
    color: white;
}

/* ========================================
   Success/Info Messages
   ======================================== */
.text-success {
    color: var(--accent-color) !important;
    font-weight: 600;
}

/* ========================================
   Container Adjustments
   ======================================== */
.container {
    max-width: 1200px;
}

main.container {
    min-height: calc(100vh - 200px);
}

/* ========================================
   Loading States (optional)
   ======================================== */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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