/* My Table Pro - Same Aditya Table Layout with Ultra Modern Search */
.mtp-frontend {
    max-width: 800px;
    margin: 20px auto;
    padding: 0 15px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ULTRA MODERN ATTRACTIVE SEARCH BOX */
.mtp-search-container {
    margin-bottom: 25px;
    text-align: center;
}

.mtp-search-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 700px;
}

.mtp-search-input {
    width: 100%;
    padding: 20px 65px 20px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 20px;
    outline: none;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    box-shadow: 
        0 10px 40px rgba(102, 126, 234, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 0 0 2px rgba(102, 126, 234, 0.1);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    color: #2d3748;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.mtp-search-input:focus {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 25px 60px rgba(102, 126, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 0 0 3px rgba(102, 126, 234, 0.2);
    background: linear-gradient(145deg, #ffffff, #f0fff4);
}

.mtp-search-input::placeholder {
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-icon {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.8;
    transition: all 0.4s ease;
    filter: drop-shadow(0 3px 6px rgba(102, 126, 234, 0.4));
}

.mtp-search-input:focus + .search-icon {
    opacity: 1;
    transform: translateY(-50%) scale(1.15) rotate(8deg);
    filter: drop-shadow(0 5px 12px rgba(102, 126, 234, 0.6));
}

/* Animated gradient border effect */
.mtp-search-wrapper::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, 
        #ff6b6b, #ffa726, #66bb6a, #42a5f5, #ab47bc, #ff6b6b);
    background-size: 400% 400%;
    border-radius: 23px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
    filter: blur(12px);
    animation: gradientRotate 8s ease infinite;
}

.mtp-search-input:focus ~ .mtp-search-wrapper::before {
    opacity: 0.7;
}

@keyframes gradientRotate {
    0%, 100% {
        background-position: 0% 50%;
        transform: scale(1);
    }
    50% {
        background-position: 100% 50%;
        transform: scale(1.02);
    }
}

/* Floating animation */
@keyframes floatSearch {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
    }
    33% { 
        transform: translateY(-2px) rotate(-1deg); 
    }
    66% { 
        transform: translateY(1px) rotate(1deg); 
    }
}

.mtp-search-input:focus {
    animation: floatSearch 4s ease-in-out infinite;
}

/* Glow pulse effect */
@keyframes glowPulse {
    0%, 100% { 
        box-shadow: 
            0 25px 60px rgba(102, 126, 234, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.95),
            0 0 0 3px rgba(102, 126, 234, 0.2);
    }
    50% { 
        box-shadow: 
            0 25px 70px rgba(102, 126, 234, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.95),
            0 0 0 3px rgba(102, 126, 234, 0.3);
    }
}

.mtp-search-input:focus {
    animation: floatSearch 4s ease-in-out infinite, glowPulse 3s ease-in-out infinite;
}

/* RESULTS - SAME AS ADITYA TABLE */
.mtp-results {
    margin-top: 16px;
}

/* TABLE GRID - MEDIUM - SAME AS ADITYA */
.modern-table-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* COMPACT MODERN TABLE - SAME AS ADITYA */
.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.07);
    border: 1px solid #e2e8f0;
    font-size: 14px;
    table-layout: fixed;
}

/* HEADER - SAME AS ADITYA */
.modern-table thead th {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    text-align: center;
    padding: 10px 8px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
}

/* BODY - IMPROVED FOR LONG TEXT */
.modern-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px dashed #e5e7eb;
    line-height: 1.4;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    vertical-align: top;
}

.modern-table tbody td:first-child {
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    width: 35%;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modern-table tbody td:last-child {
    font-weight: 500;
    color: #1f2937;
    text-align: right;
    width: 65%;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Special handling for specific long fields */
.modern-table tbody td:last-child[data-field="username"],
.modern-table tbody td:last-child[data-field="email"],
.modern-table tbody td:last-child[data-field="portal"] {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* LAST ROW - SAME AS ADITYA */
.modern-table tbody tr:last-child td {
    border-bottom: none;
}

/* VERIFIED - YES GREEN, NO RED - SAME AS ADITYA */
.modern-table .verified {
    font-weight: 700 !important;
    font-size: 14px !important;
    white-space: nowrap;
}

.modern-table .verified-yes {
    color: #16a34a !important;
}

.modern-table .verified-no {
    color: #dc2626 !important;
}

/* HOVER - SAME AS ADITYA */
.modern-table:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    transition: all 0.25s ease;
}

/* Show full text on hover for truncated cells */
.modern-table tbody td:last-child:hover {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    background: #f8fafc;
    z-index: 1;
    position: relative;
}

/* NO RESULTS - SAME AS ADITYA */
.no-result {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    background: #f9fafb;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    color: #6b7280;
    font-size: 15px;
    font-weight: 600;
}

/* LOADING STATE */
.mtp-loading {
    text-align: center;
    padding: 40px 20px;
    color: #3b82f6;
    font-size: 15px;
    font-weight: 600;
    grid-column: 1 / -1;
}

.mtp-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* INITIAL STATE */
.mtp-initial-state {
    text-align: center;
    padding: 60px 20px;
    background: #f9fafb;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    color: #6b7280;
    font-size: 15px;
    font-weight: 600;
    grid-column: 1 / -1;
}

.mtp-initial-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* RESPONSIVE - IMPROVED FOR LONG TEXT */
@media (max-width: 768px) {
    .modern-table-container {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    .modern-table {
        table-layout: auto;
    }
    
    .modern-table tbody td {
        display: block;
        width: 100%;
        text-align: left !important;
        padding: 7px 10px;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
    
    .modern-table tbody td:first-child {
        background: #f1f5f9;
        font-size: 11.5px;
        padding-top: 9px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        width: 100%;
        white-space: normal;
        text-overflow: unset;
    }
    
    .modern-table tbody td:last-child {
        padding-bottom: 9px;
        font-size: 13.5px;
        width: 100%;
        text-align: left !important;
        white-space: normal;
        text-overflow: unset;
    }
    
    /* Mobile responsive for search */
    .mtp-search-input {
        padding: 18px 55px 18px 25px;
        font-size: 15px;
        border-radius: 18px;
    }
    
    .search-icon {
        right: 20px;
        font-size: 22px;
    }
    
    .mtp-search-wrapper::before {
        border-radius: 21px;
    }
}

@media (max-width: 480px) {
    .mtp-search-input {
        padding: 16px 50px 16px 20px;
        font-size: 14px;
        border-radius: 16px;
    }
    
    .search-icon {
        right: 18px;
        font-size: 20px;
    }
}