/* Import Inter font for better typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Global styling */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    background: #000000;
    color: #ffffff;
}

/* Page-specific styles for tokens page */
.container {
    width: 100%;
    max-width: none;
    margin: 0;
    background: transparent;
    padding: 40px 24px;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    min-width: 160px;
    backdrop-filter: blur(10px);
}

.stat-number {
    font-size: 2.25rem;
    font-weight: 700;
    color: #0052FF;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: #9CA3AF;
    margin-top: 8px;
    font-weight: 500;
}

.controls-section {
    margin-bottom: 40px;
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 240px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-size: 0.9375rem;
    color: #ffffff;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.search-input:focus {
    border-color: #0052FF;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.1);
}

.search-input::placeholder {
    color: #6B7280;
}

.filter-select {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-size: 0.9375rem;
    color: #ffffff;
    outline: none;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-select:focus {
    border-color: #0052FF;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.1);
}

.filter-select option {
    background: #1a1a1a;
    color: #ffffff;
}

.view-selector {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.view-btn {
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
}

.view-btn.active {
    background: #0052FF;
    color: #ffffff;
}

.view-btn:hover:not(.active) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.tokens-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 40px;
}

.tokens-grid.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.tokens-grid.list-view {
    grid-template-columns: 1fr;
}

/* Token Card - Made Square with Fixed Aspect Ratio */
.token-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    color: inherit;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    aspect-ratio: 1; /* Makes cards square */
    height: auto;
}

.tokens-grid.list-view .token-card {
    flex-direction: row;
    align-items: center;
    gap: 24px;
    padding: 20px 24px;
    aspect-ratio: unset; /* Remove square aspect for list view */
    height: auto;
}

.token-card:hover {
    border-color: rgba(0, 82, 255, 0.3);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 82, 255, 0.1);
}

/* Top section with title, symbol and image - Compact Layout */
.token-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 16px 12px 16px;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.token-info { 
    flex: 1;
    min-width: 0; /* Allows text to truncate */
}

.token-name {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 4px 0;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.token-symbol {
    font-size: 0.875rem;
    color: #0052FF;
    font-weight: 600;
    margin: 0 0 4px 0;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.token-creator {
    font-size: 0.75rem;
    color: #9CA3AF;
    margin: 0;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.token-creator span {
    color: #6B7280;
}

.token-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

/* Description section - Compact with truncation */
.token-description-section {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
}

.token-description {
    font-size: 0.8125rem;
    color: #D1D5DB;
    line-height: 1.4;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit to 3 lines */
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* Social links section - Clean Icons Only */
.token-socials-section {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.token-socials {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.social-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Available social links - White icons */
.social-icon.available {
    color: #ffffff;
}

.social-icon.available:hover {
    color: #0052FF;
    transform: translateY(-1px);
}

/* Unavailable social links - Gray icons */
.social-icon.unavailable {
    color: #6B7280;
    cursor: not-allowed;
    opacity: 0.5;
}

.social-icon.unavailable:hover {
    color: #6B7280;
    transform: none;
    opacity: 0.5;
}

/* Bonding curve section - Compact */
.token-bonding-section {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.bonding-curve-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bonding-curve-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.bonding-curve-progress {
    height: 100%;
    background: linear-gradient(90deg, #0052FF, #0041CC);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.bonding-curve-text {
    font-size: 0.75rem;
    color: #9CA3AF;
    font-weight: 500;
    white-space: nowrap;
}

/* Market cap section - Compact */
.token-market-cap {
    padding: 12px 16px;
    text-align: center;
    flex-shrink: 0;
}

.market-cap-label {
    font-size: 0.6875rem;
    color: #6B7280;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.market-cap-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #ffffff;
}

.add-token-card {
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(0, 82, 255, 0.3);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    aspect-ratio: 1; /* Square like other cards */
    font-size: 1.125rem;
    font-weight: 600;
}

.add-token-card:hover {
    border-color: #0052FF;
    background: rgba(0, 82, 255, 0.05);
    transform: translateY(-4px);
    text-decoration: none;
    color: inherit;
}

.add-token-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    color: #0052FF;
}

.loading { 
    text-align: center; 
    padding: 60px 20px; 
    color: #9CA3AF; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 24px; 
}

.spinner { 
    width: 40px; 
    height: 40px; 
    border: 3px solid rgba(255, 255, 255, 0.1); 
    border-top: 3px solid #0052FF; 
    border-radius: 50%; 
    animation: spinLoad 1s linear infinite; 
}

@keyframes spinLoad { 
    from { transform: rotate(0deg); } 
    to { transform: rotate(360deg); } 
}

.no-tokens { 
    text-align: center; 
    color: #9CA3AF; 
    padding: 80px 20px; 
    font-size: 1.125rem; 
    line-height: 1.6; 
}

.pagination { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 16px; 
    margin-top: 40px; 
}

.pagination button { 
    padding: 10px 20px; 
    border: 1px solid rgba(255, 255, 255, 0.12); 
    background: rgba(255, 255, 255, 0.02); 
    color: #ffffff; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: all 0.2s; 
    font-weight: 500; 
    font-size: 0.9375rem; 
    font-family: inherit; 
}

.pagination button:hover:not(:disabled) { 
    background: #0052FF; 
    border-color: #0052FF; 
    transform: translateY(-1px); 
}

.pagination button:disabled { 
    opacity: 0.4; 
    cursor: not-allowed; 
    transform: none; 
}

#pageInfo { 
    color: #D1D5DB; 
    font-size: 0.875rem; 
    font-weight: 500; 
}

/* List view adjustments */
.tokens-grid.list-view .token-card {
    flex-direction: row;
    align-items: stretch;
    min-height: 120px;
    padding: 0;
}

.tokens-grid.list-view .token-header {
    border-bottom: none;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    flex: 0 0 300px;
}

.tokens-grid.list-view .token-description-section,
.tokens-grid.list-view .token-socials-section,
.tokens-grid.list-view .token-bonding-section,
.tokens-grid.list-view .token-market-cap {
    border-bottom: none;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tokens-grid.list-view .token-description-section {
    flex: 2;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.tokens-grid.list-view .token-socials-section {
    flex: 1;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.tokens-grid.list-view .token-bonding-section {
    flex: 1;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.tokens-grid.list-view .token-market-cap {
    flex: 1;
}
