/* assets/css/clubs.css */

:root {
    --primary-bg: #f5faff;
    --text-color: #003366;
    --accent-color: #0066cc;
    --card-bg: #ffffff;
    --border-color: #d0e2f3;
    --shadow-color: rgba(0, 51, 102, 0.08);
    --header-bg: #004080;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --overlay-bg: rgba(0, 0, 0, 0.5);
}

/* Fix global layout issues */
html,
body {
    height: auto !important;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

body {
    display: flex;
    flex-direction: column;
}

/* Container */
.clubs-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    /* Ensure content pushes footer down */
    min-height: 60vh;
}

/* Hero Section */
.clubs-hero {
    background: linear-gradient(135deg, #004080 0%, #0066cc 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 64, 128, 0.2);
}

.hero-content h1 {
    font-size: 2.5rem;
    margin: 0 0 0.5rem 0;
}

.hero-content .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

/* Search Bar */
.search-bar-container {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

.search-input-wrapper {
    background: white;
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-icon {
    font-size: 1.2rem;
    margin-right: 0.75rem;
    opacity: 0.6;
}

.search-input-wrapper input {
    border: none;
    font-size: 1rem;
    width: 100%;
    outline: none;
    color: var(--text-color);
}

/* Category Navigation (Pills) */
.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.category-pill {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 1.25rem;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-pill:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
}

.category-pill.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.2);
}

/* Clubs Grid */
.clubs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Club Card */
.club-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.club-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px var(--shadow-color);
    border-color: var(--accent-color);
}

.club-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.club-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    background: #f0f2f5;
    border: 2px solid var(--border-color);
}

.club-info h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--header-bg);
    line-height: 1.3;
}

.club-category-tag {
    display: inline-block;
    background: #e6f0ff;
    color: var(--accent-color);
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    margin-top: 0.25rem;
    font-weight: 600;
}

.club-description {
    font-size: 0.95rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 1.5rem;
    flex: 1;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.club-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    text-transform: uppercase;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-recruiting {
    background: #cce5ff;
    color: #004085;
}

.club-footer {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.btn-view,
.btn-join {
    flex: 1;
    padding: 0.6rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    border: none;
}

.btn-view {
    background: #f1f5f9;
    color: var(--text-color);
}

.btn-view:hover {
    background: #e2e8f0;
}

.btn-join {
    background: var(--accent-color);
    color: white;
}

.btn-join:hover {
    background: #0052a3;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    padding: 2rem;
    box-sizing: border-box;
}

.modal-large {
    max-width: 900px;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #f1f5f9;
}

/* Modal Content Styles */
.modal-banner {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #e0e7ff 0%, #f5f3ff 100%);
}

.modal-title-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.modal-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-info h2 {
    margin: 0;
    font-size: 2rem;
    color: var(--header-bg);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--header-bg);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.leadership-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.leader-item {
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 8px;
}

.leader-role {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
}

.leader-name {
    font-weight: 600;
    color: var(--text-color);
}

/* Events List in Modal */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.event-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.event-date {
    background: var(--header-bg);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-align: center;
    min-width: 60px;
}

.date-day {
    font-size: 1.5rem;
    font-weight: bold;
    display: block;
}

.date-month {
    font-size: 0.8rem;
    text-transform: uppercase;
}

.event-details h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
}

.event-meta {
    font-size: 0.85rem;
    color: #64748b;
}

/* Skeleton Loading */
.loading-state {
    display: contents;
}

.skeleton-card {
    height: 300px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 12px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .category-nav {
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 0.5rem;
        flex-wrap: nowrap;
    }

    .category-pill {
        white-space: nowrap;
    }

    .leader-item {
        font-size: 0.9rem;
    }
}

/* Join Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.95rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-color);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* =========================================
   NEW FEATURE STYLES
   ========================================= */

/* Category Nav & Sort Container */
.category-nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.category-nav {
    flex: 1;
    margin-bottom: 0;
    justify-content: flex-start;
}

.sort-select {
    padding: 0.5rem 1rem;
    border-radius: 25px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-color);
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
}

/* Section Containers */
.section-container {
    margin-top: 4rem;
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.section-header h2 {
    font-size: 1.75rem;
    color: var(--header-bg);
    margin: 0;
}

.see-all-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.see-all-link:hover {
    text-decoration: underline;
}

/* Global Events Horizontal Scroll */
.events-horizontal-scroll {
    display: flex;
    overflow-x: auto;
    gap: 1.5rem;
    padding-bottom: 1rem;
    scrollbar-width: thin;
}

.global-event-card {
    min-width: 300px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.global-event-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-color);
}

.ge-date {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    display: block;
}

.ge-title {
    font-size: 1.25rem;
    margin: 0 0 0.5rem 0;
    color: var(--header-bg);
}

.ge-info {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1rem;
}

/* Announcements Grid */
.announcements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.announcement-card {
    background: #fff;
    border-left: 5px solid var(--accent-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ann-tag {
    background: #e0f2fe;
    color: #0284c7;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
}

.ann-title {
    margin: 0.75rem 0;
    font-size: 1.2rem;
    color: var(--header-bg);
}

.ann-date {
    font-size: 0.8rem;
    color: #94a3b8;
    display: block;
    margin-top: 1rem;
}

/* Resources Grid */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.resource-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.resource-card:hover {
    box-shadow: 0 8px 24px rgba(0, 64, 128, 0.1);
    transform: translateY(-3px);
}

.res-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.res-title {
    font-size: 1.1rem;
    margin: 0 0 0.5rem 0;
    color: var(--header-bg);
}

/* Newsletter */
.newsletter-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 4rem 2rem;
    border-radius: 16px;
    text-align: center;
    margin-top: 4rem;
}

.newsletter-content {
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.newsletter-form input {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
}

/* Modal Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.gallery-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-img:hover {
    transform: scale(1.05);
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .category-nav-container {
        flex-direction: column;
        align-items: stretch;
    }

    .sort-container {
        display: flex;
        justify-content: flex-end;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}