/* /**
 * Stock Cable Interface Styles - Modern Table Design
 *
 * @package Custom_CSV_Importer
 * @since 1.0.0
 */

/* Import Manrope font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200;300;400;500;600;700;800&display=swap');

/* ==========================================================================
   Main Interface Container
   ========================================================================== */

.cci-stock-cable-interface {
    background: white;
    border-radius: 8px;
    overflow: visible; /* SCHIMBĂ DIN hidden ÎN visible */
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   Controls Bar (Filters & Search)
   ========================================================================== */

.cci-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0px;
    background: transparent;
    border-bottom: 2px solid #007cba;
    gap: 20px;
}

.cci-filters {
    display: flex;
    gap: 15px;
    align-items: center;
}

.cci-filter-dropdown,
.cci-sort-dropdown {
    padding: 10px 40px 10px 20px;
    border: 1px solid #000;
    border-radius: 25px;
    background: white;
    font-size: 14px;
    min-width: 150px;
    cursor: pointer;
    outline: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.cci-filter-dropdown:focus,
.cci-sort-dropdown:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.cci-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #000;
    border-radius: 25px;
}

.cci-search-input {
    padding: 10px 0px 10px 20px !important;
    border: none !important;
    outline: none;
    font-size: 14px;
    min-width: 250px;
    background: transparent;
    width: 100%;
    border-radius: 25px;
}

.cci-search-btn {
    padding: 8px 12px;
    background: #007cba;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.cci-search-btn:hover {
    background: #005a87;
}

.cci-search-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.6;
}

/* ==========================================================================
   Table Styles
   ========================================================================== */

.cci-table-container {
    overflow-x: auto;
}

.cci-stock-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-left: none;
    border-right: none;
}

.cci-stock-table thead {
    background: transparent;
}

.cci-stock-table th {
    padding: 8px 10px !important;
    text-align: left;
    font-weight: 600;
    color: #007cba;
    border-bottom: 2px solid #007cba;
    font-size: 14px;
}

.cci-stock-table td {
    padding: 8px 10px !important;
    border-bottom: 2px solid #007cba ;
    vertical-align: top;
    font-size: 14px;
}

.cci-stock-table tbody tr:hover {
    background: #f8f9fa;
}

/* Column specific styles */
.cci-th-image,
.cci-td-image {
    width: 160px;
    text-align: center;
}

.cci-th-name,
.cci-td-name {
    width: 150px;
    font-weight: 700;
}

.cci-th-category,
.cci-td-category {
    width: 120px;
    font-weight: 600;
    color: #666;
}

.cci-th-code,
.cci-td-code {
    width: 120px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
}

.cci-th-description,
.cci-td-description {
    width: 300px;
    max-width: 300px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-weight: 700;
}

.cci-th-length,
.cci-td-length {
    width: 100px;
    text-align: left;
    font-weight: 700;
}

.cci-th-actions,
.cci-td-actions {
    width: 100px;
    text-align: left;
}

/* Priority column styles */
.cci-th-priority,
.cci-td-priority {
    width: 100px;
    text-align: left;
}

.cci-priority-badge {
    display: inline-block;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: default;
    min-width: 40px;
    text-align: center;
}

/* Priority 3 - High (Roșu) */
.cci-priority-3,
.cci-priority-high {
    background: #dc3545;
    color: white;
}

/* Priority 2 - Medium (Portocaliu) */
.cci-priority-2,
.cci-priority-medium {
    background: #fd7e14;
    color: white;
}

/* Priority 1 - Low (Verde) */
.cci-priority-1,
.cci-priority-low {
    background: #28a745;
    color: white;
}

/* No Priority (Gri) */
.cci-priority-none {
    background: #6c757d;
    color: white;
}

/* Image placeholder */
.cci-image-placeholder {
    width: 40px;
    height: 40px;
    background: #e9ecef;
    border-radius: 4px;
    margin: 0 auto;
}

/* Item link */
.cci-item-link {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
}

.cci-item-link:hover {
    text-decoration: underline;
}

/* Action buttons */
.cci-action-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
}

.cci-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #666;
    text-decoration: none;
}


/* ==========================================================================
   Load More Button
   ========================================================================== */

.cci-load-more-container {
    text-align: center;
    padding: 20px;
}

.cci-load-more-btn {
    background: none;
    border: none;
    color: #333333;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
    border-bottom: 5px solid #379AC3;
    width: fit-content;
    line-height: 1.5;
    padding-bottom: 5px;
    display: inline-block;
    transition: color 0.3s ease;
}

.cci-load-more-btn:hover {
    color: #007cba;
}

/* ==========================================================================
   No Results
   ========================================================================== */

.cci-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* Loading state for table during AJAX requests */
.cci-stock-table tbody.loading {
    opacity: 0.6;              /* Make table semi-transparent */
    pointer-events: none;       /* Disable interactions while loading */
}

/* Loading spinner overlay */
.cci-stock-table tbody.loading::after {
    content: '';                /* Create pseudo-element for spinner */
    position: absolute;         /* Position over the table */
    top: 50%;                  /* Center vertically */
    left: 50%;                 /* Center horizontally */
    width: 20px;               /* Spinner width */
    height: 20px;              /* Spinner height */
    margin: -10px 0 0 -10px;   /* Center the spinner */
    border: 2px solid #007cba; /* Spinner border color */
    border-top: 2px solid transparent; /* Transparent top for rotation effect */
    border-radius: 50%;        /* Make it circular */
    animation: spin 1s linear infinite; /* Rotate animation */
}

/* Spinner rotation animation */
@keyframes spin {
    0% { transform: rotate(0deg); }    /* Start position */
    100% { transform: rotate(360deg); } /* End position (full rotation) */
}

/* ==========================================================================
   Mobile Cards (Hidden by default)
   ========================================================================== */

.cci-mobile-cards {
    display: none;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
    .cci-controls-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .cci-filters {
        justify-content: space-between;
    }
    
    .cci-search-wrapper {
        width: 100%;
    }
    
    .cci-search-input {
        min-width: 100px;
        flex: 1;
    }
}

@media (max-width: 768px) {
    .cci-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .cci-filter-dropdown,
    .cci-sort-dropdown {
        min-width: auto;
        width: 100%;
    }
    
    .cci-filter-group {
        width: 99%;
    }
    
    /* Hide table on mobile */
    .cci-stock-table {
        display: none;
    }
    
    /* Show mobile cards */
    .cci-mobile-cards {
        display: block;
    }
    
    .cci-mobile-card {
        background: white;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .cci-mobile-card:first-child {
        margin-top: 15px;
    }
    
    .cci-mobile-card-header {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 12px;
    }
    
    .cci-mobile-card-image {
        width: 100px;
        height: 100px;
        border-radius: 4px;
        overflow: hidden;
        flex-shrink: 0;
    }
    
    .cci-mobile-card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .cci-mobile-card-image .cci-image-placeholder {
        width: 100%;
        height: 100%;
        background: #e9ecef;
        border-radius: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .cci-mobile-card-image .cci-image-placeholder img {
        opacity: 0.5;
        filter: brightness(0) saturate(100%) invert(50%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(50%) contrast(100%);
    }
    
    .cci-mobile-card-title {
        flex: 1;
    }
    
    .cci-mobile-card-name {
        font-weight: 700;
        font-size: 16px;
        color: #333;
        margin: 0 0 4px 0;
        line-height: 1.3;
        padding-bottom: 0px;
    }
    
    .cci-mobile-card-code {
        font-family: 'Courier New', monospace;
        font-weight: 700;
        font-size: 14px;
        color: #666;
        margin: 0;
    }
    
    .cci-mobile-card-description {
        margin-bottom: 12px;
        font-size: 14px;
        line-height: 1.4;
        color: #555;
    }
    
    .cci-mobile-card-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 20px;
    }
    
    .cci-mobile-card-length {
        font-weight: 700;
        font-size: 14px;
        color: #333;
    }
    
    .cci-mobile-card-actions {
        display: flex;
        gap: 8px;
    }
    
    .cci-mobile-card-actions .cci-action-btn {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    /* Hide table on small mobile */
    .cci-stock-table {
        display: none;
    }
    
    /* Show mobile cards */
    .cci-mobile-cards {
        display: block;
    }
    
    .cci-mobile-card {
        padding: 15px;
    }
    
    .cci-mobile-card-header {
        gap: 10px;
    }
    
    .cci-mobile-card-image {
        width: 70px;
        height: 70px;
    }
    
    .cci-mobile-card-name {
        font-size: 15px;
    }
    
    .cci-mobile-card-code {
        font-size: 13px;
    }
    
    .cci-mobile-card-description {
        font-size: 13px;
    }
    
    .cci-mobile-card-actions .cci-action-btn {
        width: 32px;
        height: 32px;
    }
}

/* ==========================================================================
   Simple List Styles (keeping for backward compatibility)
   ========================================================================== */

.cci-simple-list {
    margin: 20px 0;
}

.cci-simple-list h3 {
    color: #007cba;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
}

.cci-simple-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cci-simple-list li {
    border: 1px solid #ddd;
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 5px;
    background: white;
    transition: box-shadow 0.3s ease;
}

.cci-simple-list li:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cci-simple-list .item-title {
    color: #007cba;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.cci-simple-list .item-description {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
    display: block;
}

.cci-simple-list .item-lengths {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
    display: block;
}

.cci-simple-list .item-priority {
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 5px;
    display: block;
}

.cci-simple-list .item-priority.high {
    color: #dc3545;
}

.cci-simple-list .item-priority.medium {
    color: #fd7e14;
}

.cci-simple-list .item-priority.low {
    color: #28a745;
}

.cci-simple-list .item-file-link {
    color: #007cba;
    text-decoration: none;
    font-size: 0.9em;
}

.cci-simple-list .item-file-link:hover {
    text-decoration: underline;
}

.cci-simple-list .no-results {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* ==========================================================================
   Image Popup Modal
   ========================================================================== */

.cci-image-popup {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.cci-image-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cci-image-popup img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.cci-image-popup-close {
    position: absolute;
    top: 0px;
    right: 0px;
    background: transparent;
    color: #132F51;
    border: none;
    border-radius: 0;
    width: 40px;
    height: 40px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
}

.cci-image-popup-close:hover {
    opacity: 0.7;
}

.cci-image-clickable {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.cci-image-clickable:hover {
    opacity: 0.8;
}
.cci-action-btn img {
    filter: brightness(0) saturate(100%) invert(17%) sepia(21%) saturate(1026%) hue-rotate(180deg) brightness(95%) contrast(92%);
    transition: filter 0.3s ease;
  }
  
  .cci-action-btn:hover img {
    filter: brightness(0) saturate(100%) invert(48%) sepia(76%) saturate(637%) hue-rotate(159deg) brightness(93%) contrast(91%);
  }

/* Apply Manrope font to search results */
.ais-hits--item {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Override entry-content table margins */
.entry-content table:not(.variations) {
    border: 0 !important;
}
   