/* PCRC Cycling Club Theme - Events Page */

/* CSS Variables for your color palette */
:root {
    --deep-blue: #004e9e;
    --light-blue: #1ca2dd;
    --yellow: #ffe400;
    --white: #ffffff;
    --dark-blue: #002f6c;
    --shadow: rgba(0, 78, 158, 0.3);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, var(--deep-blue) 0%, var(--dark-blue) 100%);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Animated background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, var(--light-blue) 1px, transparent 1px),
        radial-gradient(circle at 80% 20%, var(--yellow) 1px, transparent 1px);
    background-size: 100px 100px, 150px 150px;
    opacity: 0.1;
    z-index: -1;
    animation: backgroundMove 20s linear infinite;
}

@keyframes backgroundMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100px, -100px); }
}

/* EXACT HEADER FROM INDEX.CSS */
header {
    background: linear-gradient(45deg, var(--light-blue), var(--deep-blue));
    backdrop-filter: blur(10px);
    border-bottom: 3px solid var(--yellow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    max-width: none;
    z-index: 2000;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px var(--shadow);
    border-radius: 0 0 20px 20px;
    animation: slideDown 0.8s ease-out;
    margin: 0;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* EXACT LOGO FROM INDEX.CSS */
.logo {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05) rotate(2deg);
}

.logo a {
    text-decoration: none;
    color: var(--yellow);
    font-size: 1.8em;
    font-weight: bold;
}

.logo img {
    width: 80px;
    height: auto;
    border-radius: 50%;
    border: 3px solid var(--yellow);
    transition: all 0.3s ease;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 10px var(--yellow); }
    to { box-shadow: 0 0 20px var(--yellow), 0 0 30px var(--yellow); }
}

.logo img:hover {
    transform: rotate(360deg);
    border-color: var(--white);
}

/* EXACT NAVIGATION FROM INDEX.CSS */
nav {
    display: flex;
    align-items: center;
    z-index: 2001;
    position: relative;
    min-width: 0;
    flex-shrink: 0;
}

.menu {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: nowrap;
}

.menu li {
    position: relative;
}

.menu li a {
    color: var(--white);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    padding: 12px 20px;
    border-radius: 25px;
    background: linear-gradient(45deg, transparent, rgba(255, 228, 0, 0.1));
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: block;
}

.menu li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--yellow), transparent);
    transition: left 0.5s ease;
}

.menu li a:hover::before {
    left: 100%;
}

.menu li a:hover {
    background: var(--yellow);
    color: var(--dark-blue);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 228, 0, 0.4);
}

/* EXACT DROPDOWN FROM INDEX.CSS */
.dropdown .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--dark-blue);
    border: 2px solid var(--yellow);
    border-radius: 15px;
    padding: 10px 0;
    min-width: 200px;
    box-shadow: 0 10px 30px var(--shadow);
    z-index: 10000;
    list-style: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.dropdown:hover .sub-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.sub-menu li a {
    color: var(--white) !important;
    padding: 12px 20px !important;
    display: block !important;
    text-decoration: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    transition: all 0.3s ease !important;
    transform: none !important;
    box-shadow: none !important;
}

.sub-menu li a:hover {
    background: var(--light-blue) !important;
    color: var(--white) !important;
    padding-left: 30px !important;
    transform: none !important;
    box-shadow: none !important;
}

/* EXACT HAMBURGER FROM INDEX.CSS */
.nav-toggle {
    display: none;
    background: var(--yellow);
    color: var(--dark-blue);
    border: none;
    padding: 10px;
    border-radius: 10px;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-toggle:hover {
    transform: rotate(180deg);
    background: var(--white);
}

/* Main Content */
main {
    padding: 140px 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

/* TRADITIONAL CALENDAR STYLING - MATCHING YOUR HTML */
.event {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 228, 0, 0.3);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px var(--shadow);
    transition: all 0.3s ease;
    animation: fadeInUp 0.8s ease-out;
    animation-delay: 0.1s;
    animation-fill-mode: both;
    color: var(--yellow);
    text-align: center;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.event:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 50px var(--shadow);
    border-color: var(--yellow);
}

.event h1 {
    color: var(--yellow);
    margin-bottom: 20px;
    font-size: 2em;
}

.event p {
    color: var(--white);
    margin-bottom: 15px;
    font-size: 1.1em;
}

/* Calendar container */
article {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 228, 0, 0.3);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px var(--shadow);
    transition: all 0.3s ease;
    animation: fadeInUp 0.8s ease-out;
    animation-delay: 0.2s;
    animation-fill-mode: both;
}

article:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 50px var(--shadow);
    border-color: var(--yellow);
}

.calendar {
    background: var(--white);
    color: var(--dark-blue);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}

.calendar h2 {
    background: linear-gradient(45deg, var(--light-blue), var(--deep-blue));
    color: var(--white);
    padding: 20px;
    margin: 0;
    text-align: center;
    font-size: 1.8em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Calendar Header - Navigation */
.calendar-header {
    background: linear-gradient(45deg, var(--deep-blue), var(--light-blue));
    color: var(--white);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--yellow);
}

.calendar-header button {
    background: var(--yellow);
    color: var(--dark-blue);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.calendar-header button:hover {
    background: var(--white);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 228, 0, 0.5);
}

.calendar-header span {
    font-size: 1.4em;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Weekdays Header - GRID LAYOUT */
.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    background: var(--light-blue);
}

.weekdays .day {
    background: var(--light-blue);
    color: var(--white);
    padding: 15px 8px;
    text-align: center;
    font-weight: bold;
    font-size: 0.9em;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 2px solid var(--deep-blue);
}

.weekdays .day:last-child {
    border-right: none;
}

/* Calendar Days - MAIN GRID LAYOUT */
.days {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    grid-template-rows: repeat(6, 1fr) !important; /* Force 6 rows */
    gap: 0 !important;
    background: var(--white);
    width: 100% !important;
    min-height: 480px; /* Ensure consistent height */
}

/* Individual calendar day styling */
.days div {
    aspect-ratio: 1 !important;
    border: 1px solid #e0e0e0;
    padding: 10px 5px;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--white);
    color: var(--dark-blue);
    position: relative;
    min-height: 80px !important;
    max-height: 80px !important;
    font-weight: 500;
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 1em;
    overflow: hidden; /* Prevent content overflow */
}

/* Empty day cells - invisible but maintain grid structure */
.days div.empty-day {
    background: transparent !important;
    border: 1px solid #e0e0e0 !important;
    cursor: default !important;
    min-height: 80px !important;
    max-height: 80px !important;
    aspect-ratio: 1 !important;
    opacity: 0.3;
}

.days div.empty-day:hover {
    background: transparent !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Today styling - will be added by JavaScript */
.days div.today {
    background: var(--yellow) !important;
    color: var(--dark-blue) !important;
    font-weight: bold;
    box-shadow: inset 0 0 0 3px var(--deep-blue);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: inset 0 0 0 3px var(--deep-blue); 
    }
    50% { 
        box-shadow: inset 0 0 0 3px var(--deep-blue), 0 0 15px rgba(255, 228, 0, 0.7); 
    }
}

.days div.today:hover {
    background: var(--yellow) !important;
    color: var(--dark-blue) !important;
    transform: scale(1.08);
}

/* Event days - will be added by JavaScript */
.days div.event-day {
    background: linear-gradient(135deg, var(--light-blue), var(--deep-blue)) !important;
    color: var(--white) !important;
    font-weight: bold;
}

.days div.event-day::after {
    content: '🚴';
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 1em;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { 
        transform: translateY(0); 
    }
    40% { 
        transform: translateY(-5px); 
    }
    60% { 
        transform: translateY(-3px); 
    }
}

/* Other month days - will be added by JavaScript */
.days div.other-month {
    color: #999 !important;
    background: #f5f5f5 !important;
    opacity: 0.6;
}

.days div.other-month:hover {
    background: rgba(28, 162, 221, 0.3) !important;
    color: var(--white) !important;
    opacity: 1;
}

/* EXACT FOOTER FROM INDEX.CSS */
footer {
    background: linear-gradient(45deg, var(--light-blue), var(--deep-blue));
    color: var(--yellow);
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px var(--shadow);
    transition: all 0.3s ease;
    border-top: 3px solid var(--yellow);
}

footer:hover {
    transform: translateY(-5px);
    box-shadow: 0 -8px 30px var(--shadow);
}

footer p {
    margin: 10px 0;
    font-weight: 500;
    transition: all 0.3s ease;
}

footer a {
    color: var(--yellow);
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
}

footer a::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--white);
    transition: width 0.3s ease;
}

footer a:hover::before {
    width: 100%;
}

footer a:hover {
    color: var(--white);
    text-shadow: 0 0 10px var(--yellow);
}

/* EXACT SOCIAL LINKS FROM INDEX.CSS */
.social-links {
    margin: 15px 0;
    text-align: center;
}

.facebook-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1877f2;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 15px;
    border: 2px solid #1877f2;
    border-radius: 25px;
    background: linear-gradient(135deg, #ffffff, #f0f8ff);
    transition: all 0.3s ease;
    font-size: 1em;
}

.facebook-link:hover {
    background: #1877f2;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(24, 119, 242, 0.3);
}

.facebook-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(24, 119, 242, 0.2);
}

.facebook-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    fill: currentColor;
}

.facebook-link:hover .facebook-icon {
    transform: scale(1.1);
}

/* EXACT RESPONSIVE FROM INDEX.CSS */
@media (max-width: 1200px) {
    .menu {
        gap: 10px;
    }
    
    .menu li a {
        padding: 10px 15px;
        font-size: 1em;
    }
}

@media (max-width: 900px) {
    header {
        width: 100vw;
        left: 0;
        right: 0;
        max-width: none;
    }
    
    main {
        padding: 160px 20px 40px;
    }
    
    nav {
        width: 100%;
        justify-content: center;
        position: relative;
        z-index: 2001;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--dark-blue);
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 10000;
        border-radius: 0 0 20px 20px;
        padding: 20px 0;
        gap: 0;
    }
    
    .menu.active {
        display: flex;
        animation: slideDown 0.5s ease;
    }
    
    .menu li {
        padding: 10px 0;
        text-align: center;
        width: 100%;
    }
    
    /* Calendar mobile adjustments */
    .event {
        padding: 20px;
    }
    
    .event h1 {
        font-size: 1.6em;
    }
    
    .event p {
        font-size: 1em;
    }
    
    article {
        padding: 20px;
    }
    
    .calendar {
        max-width: 100%;
    }
    
    .calendar h2 {
        font-size: 1.5em;
        padding: 15px;
    }
    
    .calendar-header {
        padding: 12px 15px;
    }
    
    .calendar-header span {
        font-size: 1.2em;
    }
    
    .calendar-header button {
        width: 35px;
        height: 35px;
        font-size: 1.1em;
    }
    
    .weekdays .day {
        padding: 10px 4px;
        font-size: 0.8em;
    }
    
    .days div {
        min-height: 60px;
        padding: 8px 3px;
        font-size: 0.9em;
        aspect-ratio: 1 !important;
    }
    
    .days div.empty-day {
        min-height: 60px !important;
        max-height: 60px !important;
        aspect-ratio: 1 !important;
    }
}

@media (max-width: 768px) {
    /* Add missing 768px breakpoint */
    html, body {
        background: linear-gradient(135deg, var(--deep-blue) 0%, var(--dark-blue) 100%) !important;
        background-color: var(--deep-blue) !important;
        background-attachment: fixed !important;
    }
    
    body {
        font-size: 17px; /* Larger for better readability */
        line-height: 1.7;
    }
    
    main {
        padding: 150px 15px 30px;
    }
    
    .calendar-container {
        margin: 15px 5px;
        padding: 12px;
    }
    
    .calendar-header h1 {
        font-size: 1.8em !important;
    }
    
    .calendar-nav button {
        padding: 12px 20px;
        font-size: 1.1em;
    }
    
    /* Better calendar mobile display */
    .days {
        min-height: 280px !important;
    }
    
    .days div {
        min-height: 46px !important;
        max-height: 46px !important;
        font-size: 0.85em;
        padding: 4px 2px;
    }
    
    .event-title {
        font-size: 0.7em !important;
        margin-top: 2px;
    }
    
    section {
        padding: 22px 18px;
        font-size: 1.02em;
    }
    
    section h1, section h2 {
        font-size: 1.5em !important;
    }
    
    section p {
        font-size: 1.05em !important;
    }
}

@media (max-width: 600px) {
    /* Enhanced existing 600px code */
    body {
        font-size: 16px;
    }
    
    main {
        padding: 140px 12px 25px;
    }
    
    .calendar-container {
        margin: 10px 0;
        padding: 10px;
    }
    
    .days {
        min-height: 240px !important;
    }
    
    .days div {
        min-height: 40px !important;
        max-height: 40px !important;
        font-size: 0.8em;
        padding: 3px 1px;
    }
    
    .event-title {
        font-size: 0.6em !important;
        display: none; /* Hide on very small screens */
    }
    
    section {
        padding: 20px 15px;
        font-size: 1em;
    }
    
    section h1, section h2 {
        font-size: 1.4em !important;
    }
    
    section p {
        font-size: 1.02em !important;
    }
}

@media (max-width: 480px) {
    /* Add missing 480px breakpoint */
    html, body {
        background: linear-gradient(135deg, var(--deep-blue) 0%, var(--dark-blue) 100%) !important;
        background-color: var(--deep-blue) !important;
        background-attachment: scroll !important;
    }
    
    body {
        font-size: 15px;
    }
    
    main {
        padding: 120px 10px 20px;
    }
    
    .calendar-container {
        margin: 8px 0;
        padding: 8px;
    }
    
    .days {
        min-height: 200px !important;
    }
    
    .days div {
        min-height: 33px !important;
        max-height: 33px !important;
        font-size: 0.75em;
        padding: 2px 1px;
    }
    
    section {
        padding: 18px 12px;
        font-size: 0.98em;
    }
    
    section h1, section h2 {
        font-size: 1.3em !important;
    }
    
    section p {
        font-size: 1em !important;
    }
}

@media (max-width: 400px) {
    body {
        font-size: 14px;
    }
    
    main {
        padding: 110px 8px 18px;
    }
    
    .days div {
        min-height: 30px !important;
        max-height: 30px !important;
        font-size: 0.7em;
    }
    
    section {
        padding: 15px 10px;
    }
    
    section h1, section h2 {
        font-size: 1.2em !important;
    }
    
    section p {
        font-size: 0.95em !important;
    }
}

/* Touch improvements */
@media (max-width: 768px) {
    .calendar-nav button {
        min-height: 44px;
        min-width: 44px;
    }
    
    .days div {
        cursor: pointer;
        touch-action: manipulation;
    }
    
    .menu li a {
        padding: 15px 20px !important;
        font-size: 1.1em !important;
    }
}

/* Mobile Background Fixes */
html {
    background: linear-gradient(135deg, var(--deep-blue) 0%, var(--dark-blue) 100%);
    background-color: var(--deep-blue);
    min-height: 100%;
}

/* Enhanced Mobile Readability */
@media (max-width: 900px) {
    /* Your existing 900px code stays, add these: */
    
    html, body {
        background: linear-gradient(135deg, var(--deep-blue) 0%, var(--dark-blue) 100%) !important;
        background-color: var(--deep-blue) !important;
        background-attachment: fixed !important;
    }
    
    body {
        font-size: 16px;
        line-height: 1.7;
    }
    
    /* Better calendar mobile layout */
    .calendar-container {
        margin: 20px 10px;
        padding: 15px;
    }
    
    .days {
        min-height: 300px !important;
    }
    
    .days div {
        min-height: 50px !important;
        max-height: 50px !important;
        font-size: 0.9em;
        padding: 5px 3px;
    }
    
    /* Better event sections */
    section {
        padding: 25px 20px;
        font-size: 1.05em;
        margin-bottom: 20px;
    }
    
    section h1, section h2 {
        font-size: 1.6em !important;
        margin-bottom: 15px;
    }
    
    section p {
        font-size: 1.1em !important;
        line-height: 1.7;
    }
}