/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: #ffffff;
    border: 5px solid;
    border-image: linear-gradient(135deg, #60a5fa, #3b82f6, #8b5cf6, #7c3aed, #2563eb, #9333ea) 1;
    border-radius: 50px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.15);
    text-align: center;
    transition: all 0.4s ease;
}

.header:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 50px rgba(59, 130, 246, 0.3);
    border-image: linear-gradient(135deg, #93c5fd, #60a5fa, #c084fc, #a855f7, #3b82f6, #8b5cf6) 1;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title i {
    margin-right: 15px;
    color: #667eea;
}

.subtitle {
    font-size: 1.2rem;
    color: #718096;
    margin-bottom: 30px;
    font-weight: 400;
}

.update-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.last-updated {
    color: #718096;
    font-size: 0.9rem;
}

.refresh-btn {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.refresh-btn:active {
    transform: translateY(0);
}

/* Filters */
.filters {
    background: #ffffff;
    border: 4px solid;
    border-image: linear-gradient(135deg, #3b82f6, #8b5cf6, #2563eb, #7c3aed) 1;
    border-radius: 40px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: end;
    transition: all 0.3s ease;
}

.filters:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.25);
    border-image: linear-gradient(135deg, #60a5fa, #c084fc, #3b82f6, #a855f7) 1;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
}

.filter-group label {
    font-weight: 500;
    color: #2d3748;
    font-size: 0.9rem;
}

.filter-select,
.search-input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 30px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
}

.filter-select:focus,
.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-input {
    min-width: 250px;
}

/* Loading spinner */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border: 4px solid;
    border-image: linear-gradient(135deg, #3b82f6, #8b5cf6, #2563eb, #7c3aed) 1;
    border-radius: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Companies grid */
.companies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.company-card {
    background: #ffffff;
    border-radius: 35px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.25s ease-out;
    border: 5px solid;
    border-image: linear-gradient(135deg, #60a5fa, #8b5cf6, #3b82f6, #a855f7, #2563eb, #7c3aed) 1;
    position: relative;
    overflow: hidden;
}

.company-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px rgba(59, 130, 246, 0.4);
    border-image: linear-gradient(135deg, #93c5fd, #c084fc, #60a5fa, #a855f7, #3b82f6, #8b5cf6, #2563eb, #7c3aed) 1;
}

.company-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
    opacity: 0;
    transition: opacity 0.25s ease-out;
    pointer-events: none;
}

.company-card:hover::before {
    opacity: 1;
}

.company-card:hover .company-rank {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.company-card:hover .valuation {
    color: #3b82f6;
    text-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

.company-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.company-info h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.company-info .industry {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 400;
}

.company-rank {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 50px;
    text-align: center;
    transition: all 0.25s ease-out;
}

.valuation {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 15px;
    transition: all 0.25s ease-out;
}

.valuation .currency {
    color: #10b981;
}

.funding-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.funding-detail {
    text-align: center;
}

.funding-detail .label {
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.funding-detail .value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3748;
}

.funding-round {
    background: #3b82f6;
    color: white;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.funding-round.seed {
    background: #10b981;
}

.funding-round.series-a {
    background: #3182ce;
}

.funding-round.series-b {
    background: #805ad5;
}

.funding-round.series-c {
    background: #d69e2e;
}

.funding-round.ipo {
    background: #38b2ac;
}

.company-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.tag {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Error message */
.error-message {
    text-align: center;
    padding: 40px;
    background: #ffffff;
    border: 4px solid #dc2626;
    border-radius: 40px;
    color: #dc2626;
    margin: 20px 0;
}

.error-message i {
    font-size: 2rem;
    margin-bottom: 15px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: #718096;
    font-size: 0.9rem;
    border-top: 4px solid;
    border-image: linear-gradient(90deg, #3b82f6, #8b5cf6, #2563eb, #7c3aed) 1;
    margin-top: 40px;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        padding: 30px 25px;
    }
    
    .title {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .update-info {
        flex-direction: column;
        text-align: center;
    }
    
    .filters {
        padding: 20px;
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .companies-grid {
        grid-template-columns: 1fr;
    }
    
    .valuation {
        font-size: 1.6rem;
    }
    
    .funding-info {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
    }
    
    .company-card {
        padding: 20px;
    }
    
    .company-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .company-rank {
        text-align: left;
        width: fit-content;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes borderGlow {
    0% {
        border-image: linear-gradient(135deg, #60a5fa, #8b5cf6, #3b82f6, #a855f7, #2563eb, #7c3aed) 1;
    }
    33% {
        border-image: linear-gradient(135deg, #93c5fd, #c084fc, #60a5fa, #8b5cf6, #3b82f6, #a855f7) 1;
    }
    66% {
        border-image: linear-gradient(135deg, #3b82f6, #7c3aed, #2563eb, #9333ea, #1d4ed8, #8b5cf6) 1;
    }
    100% {
        border-image: linear-gradient(135deg, #60a5fa, #8b5cf6, #3b82f6, #a855f7, #2563eb, #7c3aed) 1;
    }
}

.company-card {
    animation: fadeInUp 0.6s ease forwards;
}

/* Removed infinite border glow animation for cleaner hover-off effect */

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
