/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
}

.header-title {
    font-size: 3rem;
    font-weight: 700;
    color: #1e3c72;
    text-align: center;
    margin-bottom: 0.5rem;
}

.header-subtitle {
    font-size: 1.2rem;
    color: #666;
    text-align: center;
    font-weight: 300;
}

/* Filter Section */
.filter-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
}

.filter-section h2 {
    color: #1e3c72;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-align: center;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.filter-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    color: #495057;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
}

.filter-btn:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #ffd700;
    border-color: #ffd700;
    color: #1e3c72;
    font-weight: 600;
}

/* Companies Grid */
.companies-section {
    margin-bottom: 3rem;
}

.companies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

/* Company Card */
.company-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 3px solid transparent;
    opacity: 1;
    transform: scale(1);
}

.company-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: #ffd700;
}

.company-card.hidden {
    display: none;
}

.company-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.company-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.company-card:hover .company-logo img {
    transform: scale(1.1);
}

.company-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1e3c72;
    margin-bottom: 0.5rem;
}

.company-category {
    background: #ffd700;
    color: #1e3c72;
    padding: 0.3rem 1rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-block;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.7);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #1e3c72;
}

.modal-content {
    padding: 2rem;
    display: flex;
    gap: 2rem;
}

.modal-logo {
    flex-shrink: 0;
}

.modal-logo img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 10px;
    border: 2px solid #f8f9fa;
}

.modal-info {
    flex: 1;
}

.modal-info h3 {
    font-size: 1.8rem;
    color: #1e3c72;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.modal-category {
    background: #ffd700;
    color: #1e3c72;
    padding: 0.3rem 1rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 1rem;
}

.modal-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 1.5rem;
}

.modal-details p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.modal-details strong {
    color: #1e3c72;
}

.modal-details a {
    color: #2a5298;
    text-decoration: none;
}

.modal-details a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-title {
        font-size: 2rem;
    }

    .filter-buttons {
        flex-direction: column;
        align-items: center;
    }

    .filter-btn {
        width: 200px;
    }

    .companies-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .modal-content {
        flex-direction: column;
        text-align: center;
    }

    .modal-logo {
        align-self: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .header {
        padding: 1.5rem 0;
    }

    .header-title {
        font-size: 1.8rem;
    }

    .filter-section {
        padding: 1.5rem;
    }

    .company-card {
        padding: 1.5rem;
    }

    .companies-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        width: 95%;
        margin: 20px;
    }

    .modal-content {
        padding: 1.5rem;
    }
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 3rem;
    color: white;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    margin: 2rem 0;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: #ffd700;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Fade-in Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.company-card {
    animation: fadeIn 0.6s ease forwards;
}
