/* Polaimath Hub - Frontend Styles */

:root {
    --hub-primary: #DC2626;
    --hub-coral: #F97171;
    --hub-green: #10B981;
    --hub-purple: #8B5CF6;
    --hub-blue: #3B82F6;
    --hub-dark: #1F2937;
    --hub-light-bg: #FEF2F2;
}

/* Grid Layout */
.hub-grid {
    display: grid;
    gap: 30px;
    margin: 40px 0;
}

.hub-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.hub-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.hub-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.hub-grid-cols-6 { grid-template-columns: repeat(6, 1fr); }

/* Card Base */
.hub-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.hub-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.15);
}

/* Card Header */
.hub-card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hub-source-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 4px;
}

.hub-source-name {
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
}

/* Card Image */
.hub-card-image {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
}

.hub-card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hub-card:hover .hub-card-image img {
    transform: scale(1.05);
}

/* Video Specific */
.hub-video-thumbnail {
    position: relative;
}

.hub-video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hub-card:hover .hub-video-overlay {
    opacity: 1;
}

.hub-play-button {
    width: 60px;
    height: 60px;
    background: var(--hub-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    padding-left: 4px;
}

.hub-video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* Card Body */
.hub-card-body {
    padding: 20px;
    flex: 1;
}

.hub-card-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.hub-category-pill {
    background: var(--hub-primary);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.hub-category-pill:hover {
    background: #B91C1C;
    transform: scale(1.05);
}

.hub-type-badge {
    background: var(--hub-light-bg);
    color: var(--hub-primary);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.hub-deadline-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-warning {
    background: #FFF7ED;
    color: #92400E;
    animation: pulse-warning 2s infinite;
}

.badge-urgent {
    background: #FEE2E2;
    color: #991B1B;
    animation: pulse-urgent 1.5s infinite;
}

.badge-expired {
    background: #F3F4F6;
    color: #6B7280;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pulse-urgent {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.hub-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--hub-dark);
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.hub-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.hub-card-title a:hover {
    color: var(--hub-primary);
}

.hub-card-excerpt {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.6;
    margin: 0;
}

/* Scholarship Specific */
.hub-scholarship-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--hub-primary);
    margin-bottom: 10px;
}

.hub-scholarship-levels {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.hub-level-badge {
    background: var(--hub-light-bg);
    color: var(--hub-primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* Resource Specific */
.hub-format-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--hub-blue);
}

.hub-resource-author {
    font-size: 13px;
    color: #6B7280;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hub-resource-cover img {
    height: 250px;
}

/* Card Footer */
.hub-card-footer {
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #6B7280;
}

.hub-card-date,
.hub-card-author,
.hub-card-views,
.hub-card-deadline,
.hub-resource-info {
    display: flex;
    align-items: center;
    gap: 5px;
}

.hub-card-footer i {
    font-size: 16px;
}

/* CTA Button */
.hub-card-cta {
    display: block;
    background: var(--hub-primary);
    color: #fff;
    text-align: center;
    padding: 12px 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.hub-card-cta:hover {
    background: #B91C1C;
    color: #fff;
    padding-right: 25px;
}

/* Modal */
.hub-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
}

.hub-modal.active {
    display: block;
}

.hub-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.8);
    animation: fadeIn 0.3s ease;
}

.hub-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 1000px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    animation: modalIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalIn {
    to { transform: translate(-50%, -50%) scale(1); }
}

.hub-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}

.hub-modal-close:hover {
    background: rgba(0,0,0,0.7);
}

.hub-modal-body {
    position: relative;
    padding-bottom: 56.25%;
}

#hub-youtube-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* No Results */
.hub-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6B7280;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 1024px) {
    .hub-grid-cols-4,
    .hub-grid-cols-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hub-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .hub-modal-content {
        width: 95%;
    }
    
    .hub-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}