/* Base styles for desktop */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, white 0%, white 100%);
    color: #000000;
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll on the body */
}

.solum-brand {
    background: linear-gradient(135deg, #000000 100%, #000000 100%);
    padding: 18px 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.aims-logo {
    height: 40px;
    width: auto;
    filter: brightness(1.1);
}

.main-content-wrapper {
    display: flex;
    gap: 5px;
    padding: 18px;
    max-width: 1600px;
    margin: 0 auto;
    align-items: flex-start;
    flex-wrap: wrap; /* Allows content to wrap to the next line on smaller screens */
}

.form-section {
    flex: 1;
    min-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    padding: 11px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
    height: fit-content;
}

.tag-type-table {
    width: 480px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(12, 11, 11, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.1);
    height: fit-content;
    max-height: calc(100vh - 130px);
    display: flex;
    flex-direction: column;
}

.generated-macs-section {
    width: 100%;
    margin-top: 25px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    padding: 35px;
    border-radius: 7px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
    height: fit-content;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

h2, h3 {
    color: #001e38;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    padding-bottom: 7px;
    margin-bottom: 12px;
}

h2 {
    font-size: 26px;
    font-weight: 600;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #3498db,#f0f0f0,#2ecc71,#e74c3c,#9b59b6);
}

h3 {
    font-size: 25px;
    font-weight: 600;
}

h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(135deg, #e74c3c, #f39c12,#898989,#ffa7b6,#00a2ff);
    border-radius: 1px;
}

/* Enhanced Label Styling - Increased gap between fields */
.form-section label {
    display: block;
    margin-bottom: 250px; /* Increased gap between fields */
    font-weight: 500;
    color: #001e38;
    position: relative;
    padding-bottom: 30px; /* Increased space for the border */
    border-bottom: 1px solid  rgba(0, 0, 0, 0.15); /* Slightly darker black border for separation */
}

.form-section label:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.label-text {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 300;
}

.label-icon {
    color: #001e38;
    font-size: 16px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    margin-right: 8px;
}

/* Input and Select Styling */
input,
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgb(172, 171, 171);
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(140, 61, 61, 0.05);
    outline: none; /* <-- Important to remove default browser outline */
}

input:focus,
select:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: rgb(100, 100, 100); /* optional subtle border color on focus */
    transform: translateY(-2px);
}

.input-group {
    margin-bottom: 25px;
}

input:disabled,
select:disabled {
    background-color: white;
    cursor: not-allowed;
    opacity: 0.7;
    border-color: rgb(174, 174, 174);
}

input[readonly] {
    background-color: white;
    cursor: default;
    border-color: rgb(175, 174, 174);
}


/* Button Styling */
.buttons {
    display: flex;
    gap: 15px;
    margin: 30px 0 25px 0;
    flex-wrap: wrap;
}

button {
    flex: 1;
    padding: 10px 18px;
    border: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 450;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    min-height: 45px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

button:first-child,
#generateBtn {
    background: linear-gradient(135deg, #33ea7f 100%, #33ea7f 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.3);
}

button:nth-child(2),
#exportFormCsvBtn,
#exportGeneratedMacsBtn {
    background: linear-gradient(135deg, #001e38 0%, #001e38 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

button:last-child,
#clearAllBtn,
#clearGeneratedMacsBtn {
    background: linear-gradient(135deg, #e33320 0%, #e33320 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.3);
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

button:active {
    transform: translateY(-1px);
}

/* Search Input Container */
.input-with-icon {
    position: relative;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.input-with-icon i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #001e38;
    font-size: 16px;
    pointer-events: none;
}

/* Table Styling */
.table-scroll-container {
    flex: 1;
    overflow-y: auto; /* Allow vertical scroll */
    overflow-x: auto; /* Allow horizontal scroll for table content if necessary */
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(226, 224, 224, 0.05);
    background: white;
    max-height: 400px; /* Default for general tables */
}

.tag-type-table .table-scroll-container {
    max-height: calc(100vh - 300px);
    min-height: 300px;
}

.generated-macs-section .table-scroll-container {
    max-height: 500px;
    min-height: 150px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: white;
}

th, td {
    padding: 15px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Ellipsis for specific columns in the tag type table descriptions */
.tag-type-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Applies ellipsis to overflowing text */
}

th {
    background: linear-gradient(135deg, #dae0e5 0%, #dbe5ee 100%);
    color: rgb(30, 31, 30);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

tbody tr:hover {
    background-color: #f1f1f1;
    transform: scale(1.001);
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Custom Scrollbar */
.table-scroll-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-scroll-container::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.table-scroll-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #b0b0b0, #c0c0c0);
    border-radius: 4px;
}

.table-scroll-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #898989, #999999);
}

.table-scroll-container::-webkit-scrollbar-corner {
    background: white;
}

/* Tablet responsive styles */
@media (max-width: 1200px) {
    .main-content-wrapper {
        flex-direction: column;
        gap: 20px;
        padding: 10px;
    }
    
    .form-section {
        min-width: unset;
        width: 100%;
    }

    .tag-type-table {
        width: 100%;
        max-height: 500px;
    }
    
    .tag-type-table .table-scroll-container {
        max-height: 350px;
    }
    
    .buttons {
        justify-content: center;
    }
    
    button {
        min-width: 140px;
    }

    .generated-macs-section {
        width: 100%;
        margin-top: 20px;
    }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .solum-brand {
        padding: 15px 20px;
        text-align: center;
    }
    
    .aims-logo {
        height: 36px;
    }
    
    .main-content-wrapper {
        padding: 15px;
        gap: 15px;
    }
    
    .form-section,
    .tag-type-table,
    .generated-macs-section {
        padding: 25px 20px;
    }
    
    .tag-type-table .table-scroll-container {
        max-height: 300px;
    }

    .generated-macs-section .table-scroll-container {
        max-height: 300px;
    }
    
    h2 {
        font-size: 22px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    h3 {
        font-size: 18px;
        flex-direction: column;
        text-align: center;
        gap: 6px;
    }
    
    .label-text {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    input, select {
        padding: 12px 15px;
        font-size: 16px;
    }
    
    .search-input {
        font-size: 16px;
    }
    
    .buttons {
        flex-direction: column;
        gap: 12px;
        margin: 25px 0 20px 0;
    }
    
    button {
        width: 100%;
        min-height: 52px;
        font-size: 14px;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 10px 8px;
    }
    
    th {
        font-size: 10px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .main-content-wrapper {
        padding: 10px;
    }
    
    .form-section,
    .tag-type-table,
    .generated-macs-section {
        padding: 20px 15px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 16px;
    }
    
    input, select {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    button {
        padding: 12px 16px;
        font-size: 13px;
        min-height: 48px;
    }
    
    table {
        font-size: 11px;
    }
    
    th, td {
        padding: 8px 6px;
    }
    
    .label-icon {
        font-size: 14px;
        width: 16px;
    }
}

/* Print styles */
@media print {
    .solum-brand,
    .buttons,
    .tag-type-table {
        display: none;
    }
    
    .main-content-wrapper {
        flex-direction: column;
        padding: 0;
    }
    
    .form-section,
    .generated-macs-section {
        box-shadow: none;
        padding: 0;
        background: white;
    }
    
    h2, h3 {
        color:#001e38 ;
    }
    
    table {
        border: 1px solid #001e38;
        page-break-inside: avoid;
    }
    
    th, td {
        border: 1px solid #001e38;
    }
}

/* Animation for form elements */
.form-section > * {
    animation: slideInLeft 0.6s ease forwards;
    opacity: 0;
    transform: translateX(-30px);
}

.tag-type-table > * {
    animation: slideInRight 0.6s ease forwards;
    opacity: 0;
    transform: translateX(30px);
}

.generated-macs-section {
    animation: fadeInScale 0.8s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInScale {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-section > *:nth-child(1) { animation-delay: 0.1s; }
.form-section > *:nth-child(2) { animation-delay: 0.2s; }
.form-section > *:nth-child(3) { animation-delay: 0.3s; }
.form-section > *:nth-child(4) { animation-delay: 0.4s; }
.form-section > *:nth-child(5) { animation-delay: 0.5s; }
.form-section > *:nth-child(6) { animation-delay: 0.6s; }
.form-section > *:nth-child(7) { animation-delay: 0.7s; }

.tag-type-table > *:nth-child(1) { animation-delay: 0.2s; }
.tag-type-table > *:nth-child(2) { animation-delay: 0.4s; }
.tag-type-table > *:nth-child(3) { animation-delay: 0.6s; }

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading state for buttons */
.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Focus states for accessibility */
button:focus,
input:focus,
select:focus {
    outline: 2px solid;
    outline-offset: 2px;
}

/* Enhanced hover effects */
.form-section:hover,
.tag-type-table:hover,
.generated-macs-section:hover {
    box-shadow: 0 15px 35px rgba(0,0,0,0.1) ;
    transform: translateY(-2px);
    transition: all 0.3s ease;
}
#unifiedTagTableBody tr {
    /* Changes the mouse cursor to a hand pointer when hovering over rows */
    cursor: pointer;
}

#unifiedTagTableBody tr:hover {
    /* Optional: Provides visual feedback when a row is hovered */
    background-color: #e0e0e0; /* A slightly darker gray on hover */
    transition: background-color 0.2s ease; /* Smooth transition for the hover effect */
}
/* Add this to your style.css */


/* Add this to your style.css */
/* style.css */

/* Add these rules at the end of your style.css or in an appropriate section */

/* Styles for the Available Tag Type Codes table (unifiedTagTable) */
#unifiedTagTable tbody td:nth-child(1) { /* Targets the first column (Description) in the tbody */
    max-width: 250px; /* Adjust this value as needed. This sets the width at which text will truncate. */
    white-space: nowrap; /* Prevents the text from wrapping to the next line */
    overflow: hidden;    /* Hides the overflowing text */
    text-overflow: ellipsis; /* Displays an ellipsis (...) for hidden overflowed text */
}

/* Optional: You might want to adjust the width of the header as well if needed */
#unifiedTagTable thead th:nth-child(1) { /* Targets the first header column (DESCRIPTION) */
    max-width: 250px; /* Should match or be similar to the td width for alignment */
}

/* You might also need to adjust the overall table layout slightly if the columns become too narrow */
.tag-type-table .table-scroll-container {
    overflow-x: auto; /* Ensures horizontal scrolling if content is wider than container */
}

/* Ensure table cells (td, th) have padding and alignment if not already defined */
.tag-type-table table th,
.tag-type-table table td {
    padding: 8px 12px;
    text-align: left;
    vertical-align: middle;
}

/* If the text is still wrapping when it shouldn't, check if the table-layout property is set to fixed */
#unifiedTagTable {
    width: 100%;
    table-layout: fixed; /* Important for fixed column widths with ellipsis */
}
