/* Invisible Unicode Table - Professional Design */

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.iut-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    background: #000000;
    border-radius: 16px;
    position: relative;
    min-height: 100vh;
}

/* Search Bar Section */
.iut-search-bar {
    margin-bottom: 2rem;
    background: #1e293b;
    padding: 1.5rem;
    border-radius: 16px;
    border: none;
}

#iut-search {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid #475569;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    background: #334155;
    color: white;
    font-weight: 500;
}

#iut-search::placeholder {
    color: #94a3b8;
}

#iut-search:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: #475569;
}

/* Filter Buttons */
.iut-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    margin-top: 1rem;
    gap: 1rem;
    justify-content: flex-wrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.iut-filter-buttons::-webkit-scrollbar {
    display: none;
}

.iut-filter-buttons {
    scrollbar-width: none;
}

.iut-filter-btn {
    padding: 0.7rem 1.4rem;
    border: 2px solid #475569;
    background: #334155;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    color: #cbd5e1;
}

.iut-filter-btn:hover {
    border-color: #667eea;
    background: #475569;
    color: white;
}

.iut-filter-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Mobile Cards Section */
.iut-mobile-cards {
    display: block;
}

.iut-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.iut-card:hover {
    border-color: #667eea;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.iut-card-header {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    gap: 1rem;
    background: white;
}

.iut-card-example {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: #1a1a1a;
    border: 2px solid #333333;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    position: relative;
    color: white;
}

.iut-card-example::before {
    content: '[ ]';
    position: absolute;
    color: #666666;
    font-size: 1.1rem;
    z-index: 1;
    font-weight: bold;
}

.iut-card-info {
    flex: 1;
    min-width: 0;
}

.iut-card-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.3rem 0;
    line-height: 1.3;
}

.iut-card-description {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.iut-copy-btn {
    flex-shrink: 0;
    background: #667eea !important;
    color: white !important;
    border: none;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    min-width: 50px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.iut-copy-btn:hover {
    background: #5a67d8 !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.iut-copy-btn:active {
    transform: scale(0.95);
}

.iut-copy-btn.copied {
    background: #10b981 !important;
    animation: pulse 0.6s ease;
}

/* Mobile copy button styles */
@media (max-width: 1023px) {
    .iut-copy-btn .iut-copy-text {
        display: none;
    }
    
    .iut-copy-btn .iut-copy-icon {
        display: inline;
        font-size: 1.2rem;
    }
}

/* Card Details Section */
.iut-card-details {
    padding: 1rem 1.25rem 1.25rem 1.25rem;
    border-top: none;
    background: white;
}

.iut-detail-item {
    display: flex;
    align-items: center;
    padding: 0.7rem 0;
    gap: 0.8rem;
    flex-wrap: nowrap;
}

.iut-detail-item:first-child {
    padding-top: 1rem;
}

.iut-detail-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 80px;
    flex-shrink: 0;
}

.iut-detail-item code {
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    flex: 1;
    min-width: 0;
    word-break: break-all;
    font-weight: 600;
    box-shadow: none;
    text-align: center;
}

/* Color-coded mobile card codes */
.iut-detail-item:nth-child(1) code {
    background: #dc2626;
    color: white;
}

.iut-detail-item:nth-child(2) code {
    background: #2563eb;
    color: white;
}

.iut-detail-item:nth-child(3) code {
    background: #16a34a;
    color: white;
}

/* Table Section (Desktop) */
.iut-table-wrapper {
    display: none;
    overflow: hidden;
    border-radius: 12px;
    background: white;
    max-height: 600px;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.iut-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 0.9rem;
}

.iut-table thead {
    position: sticky;
    top: 0;
    background: #334155;
    z-index: 10;
}

.iut-table th {
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: white;
    border-bottom: none;
    white-space: nowrap;
    font-size: 0.9rem;
}

.iut-table td {
    padding: 0.8rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    background: white;
}

.iut-table tbody tr:hover {
    background: #f8fafc;
}

.iut-table tbody tr:last-child td {
    border-bottom: none;
}

.iut-char-preview {
    width: 45px;
    height: 45px;
    background: #1a1a1a;
    border: 2px solid #333333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 1.2rem;
    position: relative;
    color: white;
}

.iut-char-preview::before {
    content: '[ ]';
    position: absolute;
    color: #666666;
    font-size: 0.9rem;
    z-index: 1;
    font-weight: bold;
}

.iut-name {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
}

.iut-description {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.3;
}

.iut-table code {
    border: none;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    display: inline-block;
    max-width: 100%;
    word-break: break-all;
    font-weight: 600;
    color: white;
}

/* Color-coded table codes */
.iut-table .iut-col-html code,
.iut-html-code {
    background: #dc2626 !important;
    color: white !important;
}

.iut-col-unicode code {
    background: #2563eb !important;
    color: white !important;
}

.iut-col-css code {
    background: #16a34a !important;
    color: white !important;
}

.iut-copy-icon {
    display: inline;
    font-size: 1rem;
}

.iut-copy-text {
    font-size: 0.8rem;
    font-weight: 600;
}

/* Stats Section */
.iut-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
    padding: 1.5rem;
    background: #1e293b;
    border-radius: 12px;
    border: none;
}

.iut-stat-item {
    text-align: center;
}

.iut-stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: #667eea;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.iut-stat-label {
    font-size: 0.85rem;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
    font-weight: 600;
}

/* Utility Classes */
.iut-hidden {
    display: none !important;
}

.iut-loading {
    opacity: 0.6;
    pointer-events: none;
}

.iut-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.iut-card {
    animation: fadeIn 0.3s ease;
}

/* Responsive Design */

/* Small Tablets (600px+) */
@media (min-width: 600px) {
    .iut-container {
        padding: 2rem;
    }
    
    .iut-filter-buttons {
        justify-content: center;
    }
    
    .iut-card-header {
        padding: 1.5rem;
    }
    
    .iut-card-details {
        padding: 0 1.5rem 1.5rem 1.5rem;
    }
    
    .iut-detail-item {
        flex-wrap: nowrap;
    }
    
    .iut-stats {
        gap: 3rem;
    }
}

/* Large Tablets (768px+) */
@media (min-width: 768px) {
    .iut-container {
        max-width: 1200px;
    }
    
    #iut-search {
        font-size: 1rem;
    }
    
    .iut-search-bar {
        display: content;
        justify-content: center;
        gap: 4rem;
        padding: 1.5rem;
    }
    
    #iut-search {
        margin-bottom: 0;
        flex: 1;
    }
    
    .iut-filter-buttons {
        flex-shrink: 0;
    }
    
    .iut-card {
        margin-bottom: 1.5rem;
    }
}

/* Desktop (1024px+) - Switch to Table View */
@media (min-width: 1024px) {
    .iut-mobile-cards {
        display: none;
    }
    
    .iut-table-wrapper {
        display: block;
    }
    
    .iut-copy-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        min-width: auto;
        min-height: auto;
    }
    
    .iut-copy-text {
        display: inline;
    }
    
    .iut-copy-icon {
        display: none;
    }
    
    .iut-col-example {
        width: 80px;
    }
    
    .iut-col-name {
        min-width: 200px;
    }
    
    .iut-col-html,
    .iut-col-unicode,
    .iut-col-css {
        width: 120px;
    }
    
    .iut-col-action {
        width: 100px;
    }
}

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .iut-table {
        font-size: 1rem;
    }
    
    .iut-table th {
        padding: 1.25rem 1rem;
        font-size: 1rem;
    }
    
    .iut-table td {
        padding: 1rem;
    }
    
    .iut-col-name {
        min-width: 250px;
    }
    
    .iut-col-html,
    .iut-col-unicode,
    .iut-col-css {
        width: 140px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .iut-container {
        background: #1e293b;
        color: #f1f5f9;
    }
    
    .iut-search-bar {
        background: #334155;
        border-color: #475569;
    }
    
    #iut-search {
        background: #0f172a;
        border-color: #334155;
        color: #e2e8f0;
    }
    
    #iut-search::placeholder { 
        color: #94a3b8; 
    }
    
    .iut-filter-btn {
        background: #334155;
        border-color: #475569;
        color: #cbd5e1;
    }
    
    .iut-card {
        background: #334155;
        border-color: #475569;
    }
    
    .iut-stats {
        background: #334155;
        border-color: #475569;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .iut-copy-btn,
    .iut-card,
    .iut-filter-btn {
        transition: none;
    }
    
    .iut-copy-btn:hover {
        transform: none;
    }
    
    .iut-card:hover {
        transform: none;
    }
    
    .iut-card {
        animation: none;
    }
}

/* Very small phones */
@media (max-width: 480px) {
    .iut-filter-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
    
    .iut-container {
        padding: 0.5rem;
    }
    
    .iut-search-bar {
        padding: 1rem;
    }
    
    .iut-card-header {
        padding: 1rem;
    }
    
    .iut-card-example {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .iut-copy-btn {
        min-width: 45px;
        min-height: 45px;
        padding: 0.7rem;
    }
    
    /* Mobile copy button styles */
    .iut-copy-btn .iut-copy-text {
        display: none;
    }
    
    .iut-copy-btn .iut-copy-icon {
        display: inline;
        font-size: 1.2rem;
    }
}