﻿/* Modern Professional Styling for Compiler Dashboard */

/* CSS Variables for consistent theming */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --error-color: #dc2626;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    padding-bottom: 20px;
}

/* Enhanced container styling */
.dataContainer {
    width: 100%;
    max-width: 100%;
    margin: 2rem auto;
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    transition: var(--transition);
}

.dataContainer:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Content padding */
.body-content {
    padding-left: 2rem;
    padding-right: 2rem;
    margin-top: 2rem;
}

/* Typography improvements */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

/* Form controls */
input,
select,
textarea {
    max-width: 100%;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
    background-color: var(--surface-color);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

/* Enhanced customer data styling - Made more compact */
.custData {
    width: 100%;
    padding: 0.75rem 1rem; /* Reduced from 1.5rem */
    margin-bottom: 1rem; /* Reduced from 2rem */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    color: white;
    position: relative;
    overflow: hidden;
    display: flex; /* Added flex to align items horizontally */
    align-items: center; /* Center align items vertically */
    gap: 0.75rem; /* Space between icon and text */
    min-height: 3rem; /* Set minimum height for consistency */
}

.custData::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px; /* Reduced from 4px */
    background: linear-gradient(90deg, #fbbf24, #f59e0b, #d97706);
}

.dataLabel {
    font-size: 1.1rem; /* Reduced from 1.4rem */
    font-weight: 600; /* Reduced from 700 */
    color: white;
    text-shadow: 0 2px 4px rgb(0 0 0 / 0.2);
    margin: 0; /* Remove default margin */
    line-height: 1.2; /* Tighter line height */
}

.dataLabel span {
    display: inline; /* Changed from block to keep on same line */
}

.dataLabel span:last-child {
    font-size: 0.8rem; /* Reduced from 0.875rem */
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    margin-top: 0; /* Remove top margin */
    margin-left: 0.5rem; /* Add left margin instead */
}

/* Button styling */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, var(--primary-dark), #1e40af);
}

.saveStylesButtons,
.uploadLogoButton {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    text-align: center;
    min-width: 140px;
}

.saveStylesButtons:hover,
.uploadLogoButton:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, var(--primary-dark), #1e40af);
}

/* DataTables styling enhancements */
.dataTables_wrapper {
    padding: 1rem 0;
}

.dataTables_filter {
    float: right;
    margin-bottom: 1rem;
}

.dataTables_filter input {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-left: 0.5rem;
    width: 250px;
}

.dataTables_length select {
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    margin: 0 0.5rem;
}

.dataTables_info {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 1rem;
}

.dataTables_paginate {
    margin-top: 1rem;
}

.dataTables_paginate .paginate_button {
    padding: 0.5rem 0.75rem;
    margin: 0 2px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--surface-color);
    color: var(--text-primary);
    transition: var(--transition);
    text-decoration: none;
}

.dataTables_paginate .paginate_button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.dataTables_paginate .paginate_button.current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Table styling */
.table {
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-weight: 600;
    padding: 1rem;
    border: none;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

.table tbody td {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f8fafc;
}

.table-hover tbody tr:hover {
    background-color: #f1f5f9;
    transform: scale(1.01);
    transition: var(--transition);
}

/* Details control styling - Updated for inline display */
td.details-control,
div.details-control {
    background: url('Icons/details_open.png') no-repeat center center;
    background-size: 16px 16px;
    cursor: pointer;
    position: relative;
    width: 32px; /* Reduced from 40px */
    height: 32px; /* Reduced from 40px */
    border-radius: 50%;
    transition: var(--transition);
    flex-shrink: 0; /* Prevent shrinking in flex container */
}

/* For the expandData class used in custData */
.custData .details-control.expandData {
    width: 24px; /* Even smaller for inline display */
    height: 24px;
    background-size: 14px 14px;
}

td.details-control:hover,
div.details-control:hover {
    background-color: rgba(255, 255, 255, 0.2); /* More subtle hover for inline display */
    transform: scale(1.1);
}

tr.shown td.details-control,
div.details-control-close {
    background: url('Icons/details_close.png') no-repeat center center;
    background-size: 16px 16px;
}

.custData .details-control-close.expandData {
    background-size: 14px 14px;
}

/* Responsive design */
@media (max-width: 768px) {
    .body-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .dataContainer {
        margin: 1rem;
        padding: 1rem;
    }
    
    .custData {
        padding: 0.5rem 0.75rem; /* Further reduced for mobile */
        min-height: 2.5rem; /* Smaller minimum height for mobile */
        flex-direction: column; /* Stack on mobile if needed */
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .dataLabel {
        font-size: 1rem; /* Further reduced for mobile */
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.75rem 0.5rem;
    }
}

/* Enhanced loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Status indicators */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-success {
    background-color: rgb(220 252 231);
    color: var(--success-color);
}

.status-warning {
    background-color: rgb(254 243 199);
    color: var(--warning-color);
}

.status-error {
    background-color: rgb(254 226 226);
    color: var(--error-color);
}

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Enhanced focus styles for accessibility */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.p-4 { padding: 1.5rem; }

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Legacy styles maintained for compatibility */
.padding-error {
    padding-top: 20px;
}

.customerUrl,
.customerSiteName {
    font-size: 11pt;
}

.cssStyles {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    height: 200px;
    width: 100%;
    max-width: 900px;
    overflow: auto;
    background: var(--surface-color);
    font-family: 'Courier New', monospace;
}

.customerLogosContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.dt-container {
    margin-bottom: 2rem;
}

/* Child row styling */
table.table.dataTable.table-hover > tbody > tr.childOpen:hover,
.table-hover > tbody > tr.childOpen:hover {
    background-color: transparent !important;
    --bs-table-hover-bg: transparent !important;
}

table.table.dataTable.table-hover > tbody > tr.childOpen > td {
    padding-bottom: 3rem;
    background-color: #f8fafc;
    border-bottom: 2px solid var(--border-color);
}
