/**
 * Club CMS - Main Stylesheet
 * Uses CSS custom properties for easy theming
 */

/* CSS Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base Styles */
html {
    font-size: var(--font-size-base, 16px);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body, 'Open Sans', sans-serif);
    color: var(--text-color, #1f2937);
    background-color: var(--background-color, #ffffff);
    line-height: var(--line-height, 1.6);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

h1 { font-size: var(--font-size-h1, 2.5rem); }
h2 { font-size: var(--font-size-h2, 2rem); }
h3 { font-size: var(--font-size-h3, 1.75rem); }
h4 { font-size: var(--font-size-h4, 1.5rem); }

p {
    margin-bottom: 1em;
}

a {
    color: var(--primary-color, #2563eb);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--secondary-color, #1e40af);
}

img {
    max-width: 100%;
    height: auto;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--content-max-width, 1200px);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header / Navigation */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--header-bg-color, #1f2937);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.site-header.transparent {
    background-color: transparent;
}

.site-header.transparent.scrolled {
    background-color: var(--header-bg-color, #1f2937);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    max-width: var(--content-max-width, 1200px);
    margin: 0 auto;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--header-text-color, #ffffff);
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
}

.site-logo img {
    height: 40px;
    width: auto;
}

.site-logo .favicon {
    height: 32px;
    width: 32px;
    object-fit: contain;
}

/* Main Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 5px;
}

.main-nav a {
    color: var(--header-text-color, #ffffff);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.main-nav .btn-login {
    background-color: var(--primary-color, #2563eb);
    margin-left: 10px;
}

.main-nav .btn-login:hover {
    background-color: var(--secondary-color, #1e40af);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    cursor: pointer;
    background: none;
    border: none;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--header-text-color, #ffffff);
    border-radius: 2px;
    transition: transform 0.3s ease;
}

/* Hero Section */
.hero {
    position: relative;
    height: var(--hero-height, 70vh);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, var(--hero-overlay-opacity, 0.5));
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 20px;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-tagline {
    font-size: clamp(1rem, 2vw, 1.5rem);
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    position: relative;
    height: var(--page-header-height, 40vh);
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    margin-top: 70px;
    overflow: hidden;
}

.page-header-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, var(--hero-overlay-opacity, 0.5));
}

.page-header-content {
    position: relative;
    z-index: 1;
    padding: 20px;
}

.page-header-title {
    font-size: clamp(2rem, 4vw, 3rem);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 15px 0;
    font-size: 0.875rem;
}

.breadcrumbs a {
    color: var(--text-color, #1f2937);
    opacity: 0.7;
}

.breadcrumbs a:hover {
    opacity: 1;
}

.breadcrumbs span {
    margin: 0 8px;
    opacity: 0.5;
}

/* Main Content */
main {
    flex: 1;
    padding: 40px 0;
}

.page-content {
    max-width: var(--content-max-width, 1200px);
    margin: 0 auto;
    padding: 0 20px;
}

/* Cards */
.card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-body {
    padding: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color, #2563eb);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--secondary-color, #1e40af);
    color: #ffffff;
}

.btn-secondary {
    background-color: var(--secondary-color, #1e40af);
    color: #ffffff;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color, #2563eb);
    color: var(--primary-color, #2563eb);
}

.btn-outline:hover {
    background-color: var(--primary-color, #2563eb);
    color: #ffffff;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.125rem;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-color, #1f2937);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-warning {
    background-color: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.alert-info {
    background-color: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* Footer */
.site-footer {
    background-color: var(--footer-bg-color, #1f2937);
    color: var(--footer-text-color, #ffffff);
    padding: 40px 0 20px;
    margin-top: auto;
}

.footer-content {
    max-width: var(--content-max-width, 1200px);
    margin: 0 auto;
    padding: 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    margin-bottom: 15px;
    font-size: 1.125rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul a {
    color: var(--footer-text-color, #ffffff);
    opacity: 0.8;
}

.footer-section ul a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Social Icons */
.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--footer-text-color, #ffffff);
    transition: background-color 0.2s ease;
}

.social-icons a:hover {
    background-color: var(--primary-color, #2563eb);
}

/* Login Modal / Page */
.auth-container {
    max-width: 400px;
    margin: 80px auto 40px;
    padding: 30px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 25px;
}

/* Members Area */
.members-dashboard {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    margin-top: 90px;
    min-height: calc(100vh - 90px);
}

.members-sidebar {
    background: #f8fafc;
    padding: 20px;
    border-right: 1px solid #e2e8f0;
}

.members-sidebar nav a {
    display: block;
    padding: 12px 16px;
    color: var(--text-color, #1f2937);
    border-radius: 8px;
    margin-bottom: 5px;
}

.members-sidebar nav a:hover,
.members-sidebar nav a.active {
    background-color: var(--primary-color, #2563eb);
    color: #ffffff;
}

.members-content {
    padding: 30px;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.hidden { display: none !important; }

/* Grid */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--header-bg-color, #1f2937);
        flex-direction: column;
        padding: 20px;
        display: none;
    }
    
    .main-nav.active {
        display: flex;
    }
    
    .main-nav a {
        width: 100%;
        text-align: center;
        padding: 12px;
    }
    
    .hero {
        height: 60vh;
    }
    
    .page-header {
        height: 35vh;
    }
    
    .members-dashboard {
        grid-template-columns: 1fr;
    }
    
    .members-sidebar {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .page-header-title {
        font-size: 1.75rem;
    }
    
    .auth-container {
        margin: 70px 15px 30px;
        padding: 20px;
    }
}
