/* ========================================
   CSRA UI Styles
   ======================================== */

/* CSS Variables */
:root {
    --main-color-gold: #cfb97d;
    --error-color: #ff6b6b;
    --success-color: #51cf66;
    --text-dark: #333333;
    --text-light: #999999;
    --background-dark: #000000;
    --background-light: #ffffff;
    --background-gray: #f5f5f5;
    --border-light: #e0e0e0;
    --blue-accent: #007aff;
    --light-gray-text: #bbbbbb;
}

/* ========================================
   Global Styles
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    /* Disable pinch zoom for mobile app feel */
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Disable zoom on mobile devices */
.mobile-app-layout {
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
}

/* ========================================
   Pull to Refresh Styles
   ======================================== */

.pull-to-refresh {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--background-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 16px;
    opacity: 1;
    transform: translateY(-100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    gap: 8px;
    border-bottom: 1px solid var(--border-light);
}

.pull-to-refresh.visible {
    opacity: 1;
}

.pull-to-refresh.refreshing .refresh-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.events-main.pulling {
    transition: none;
}

.events-main.snapping {
    transition: transform 0.3s ease-out;
}

.events-list.pulling {
    transition: none;
}

.events-list.snapping {
    transition: transform 0.3s ease-out;
}

/* ========================================
   Events Layout
   ======================================== */

.events-layout {
    background: var(--background-gray);
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto; /* header, main, footer */
    grid-template-areas: 
        "header"
        "main"
        "footer";
    overflow: hidden;
    position: relative;
}

.events-header {
    grid-area: header;
    background: var(--main-color-gold);
    padding: 15px 20px 20px;
    text-align: center;
    color: var(--background-dark);
    position: relative;
    z-index: 101;
}

.events-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.events-main {
    grid-area: main;
    overflow-y: auto;
    position: relative;
}

.events-footer {
    grid-area: footer;
    background: var(--main-color-gold);
    display: flex;
    justify-content: space-around;
    padding: 15px 0 20px;
    color: var(--background-dark);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    text-decoration: none;
    color: black;
}

.nav-item.active {
    opacity: 1;
}

.nav-icon {
    font-size: 20px;
}

.nav-icon i {
    font-size: 20px;
    display: block;
}

.nav-label {
    font-size: 12px;
    font-weight: 500;
}

/* ========================================
   Events List
   ======================================== */

.events-list {
    background: var(--background-light);
    margin: 0;
    height: 100%;
}

.no-events-message {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 60px - 80px); /* Full viewport minus header minus footer */
    text-align: center;
    background: var(--background-light);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.no-events-message p {
    color: var(--light-gray-text);
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}

.event-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--background-light);
    transition: background-color 0.3s ease;
    cursor: pointer;
    gap: 15px;
    text-decoration: none;
    color: inherit;
}

.event-item:hover {
    background: #f8f8f8;
    text-decoration: none;
    color: inherit;
}

.event-item:visited {
    color: inherit;
}

.event-item:active {
    background: #f0f0f0;
}

.event-item:last-child {
    border-bottom: none;
}

.event-date-card {
    flex-shrink: 0;
    width: 70px;
    text-align: center;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    background: var(--background-light);
}

.event-date-card .month {
    background: var(--blue-accent);
    color: white;
    padding: 5px 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.event-date-card .day {
    padding: 8px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.event-date-card .year {
    padding: 2px 8px 8px;
    font-size: 11px;
    color: var(--text-light);
    font-weight: 500;
}

.event-details {
    flex: 1;
    min-width: 0; /* Allows text to wrap */
}

.event-type {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 4px;
    font-weight: 400;
}

.event-title {
    font-size: 16px;
    color: var(--text-dark);
    font-weight: 500;
    line-height: 1.3;
    word-wrap: break-word;
}

.event-arrow {
    flex-shrink: 0;
    font-size: 20px;
    color: var(--text-light);
    margin-left: 10px;
}

/* ========================================
   Event Details Layout
   ======================================== */

.event-details-layout {
    background: var(--background-light);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.event-details-header {
    background: var(--main-color-gold);
    padding: 15px 20px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--background-dark);
}

.back-arrow {
    font-size: 24px;
    cursor: pointer;
    font-weight: 600;
    padding: 5px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

.back-arrow:hover {
    opacity: 0.7;
    text-decoration: none;
    color: inherit;
}

.back-arrow:visited {
    color: inherit;
}

.event-details-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    flex: 1;
    text-align: center;
}

.header-spacer {
    width: 34px; /* Same width as back arrow for centering */
}

.event-details-main {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 80px; /* Space for footer */
}

.event-details-content {
    padding: 20px;
    background: var(--background-light);
    min-height: 100%;
}

/* ========================================
   Event Details Content
   ======================================== */

.event-meta {
    margin-bottom: 20px;
}

.event-date,
.event-time {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 5px;
    font-weight: 400;
}

.event-detail-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 20px 0;
    line-height: 1.2;
}

.event-description {
    margin: 20px 0 30px;
}

.event-description p {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 5px;
    line-height: 1.4;
}

.location-section,
.rsvp-section,
.links-section {
    margin: 30px 0;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.location-address
,.section-description{
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 10px;
    line-height: 1.4;
}

.view-maps-link
,.view-link  {
    color: var(--blue-accent);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
}

.view-maps-link:hover {
    text-decoration: underline;
}

.cover-drinks-wrapper{
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 30px 0;
    padding: 20px 0;
}

.cover-drinks-column-left{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}

.cover-drinks-column-right{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cover-drinks-button {
    background: #9E9E9E;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    min-width: 80px;
    text-align: center;
}

.cover-drinks-button:hover {
    background: #8E8E8E;
    transform: translateY(-1px);
    text-decoration: none;
    color: white;
}

.cover-drinks-button:active {
    transform: translateY(0);
}

/* ========================================
   RSVP Buttons
   ======================================== */

.rsvp-buttons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.rsvp-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #9E9E9E;
    color: white;
    text-decoration: none;
}

.rsvp-btn.active {
    background: #4CAF50;
}

.rsvp-btn:hover {
    background: #888888;
    transform: translateY(-1px);
}

/* ========================================
   Mobile Responsive Adjustments
   ======================================== */

@media (max-width: 480px) {
    .event-item {
        padding: 12px 15px;
        gap: 12px;
    }
    
    .event-date-card {
        width: 60px;
    }
    
    .event-date-card .day {
        font-size: 20px;
        padding: 6px;
    }
    
    .event-title {
        font-size: 15px;
    }
    
    .events-header h1 {
        font-size: 22px;
    }
    
    /* Event Details Mobile Styles */
    .event-details-content {
        padding: 15px;
    }
    
    .event-detail-title {
        font-size: 24px;
    }
    
    .event-details-header h1 {
        font-size: 20px;
    }
    
    .back-arrow {
        font-size: 20px;
    }
    
    .rsvp-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .rsvp-btn {
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .section-title {
        font-size: 16px;
    }
    
    .event-date,
    .event-time,
    .location-address,
    .view-maps-link {
        font-size: 15px;
    }
}

/* ========================================
   Global Styles
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ========================================
   Layout Components
   ======================================== */

/* Full Screen Layout with Gold Bars */
.layout-with-bars {
    background: var(--background-dark);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.layout-with-bars::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--main-color-gold);
    z-index: 1000;
}

.layout-with-bars::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--main-color-gold);
    z-index: 1000;
}

/* ========================================
   Login Components
   ======================================== */

.login-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    position: relative;
    z-index: 1;
    margin: 60px 0;
}

.logo-container {
    text-align: center;
    margin-bottom: 0;
}

.logo-container img {
    max-width: 200px;
    height: auto;
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========================================
   Form Components
   ======================================== */

.form-group {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: 12px;
    background: var(--background-light);
    font-size: 16px;
    color: var(--text-dark);
    outline: none;
    transition: all 0.3s ease;
}

.form-input::placeholder {
    color: var(--text-light);
    font-size: 16px;
}

.form-input:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.form-input[type="password"] {
    letter-spacing: 2px;
}

.form-input[type="password"]::placeholder {
    letter-spacing: normal;
}

/* ========================================
   Button Components
   ======================================== */

.btn-primary {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: 12px;
    background: var(--main-color-gold);
    color: var(--background-dark);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--main-color-gold), #b8a568);
    box-shadow: 0 5px 15px rgba(207, 185, 125, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Legacy login button class for backward compatibility */
.login-button {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: 12px;
    background: var(--main-color-gold);
    color: var(--background-dark);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.login-button:hover {
    background: linear-gradient(135deg, var(--main-color-gold), #b8a568);
    box-shadow: 0 5px 15px rgba(207, 185, 125, 0.3);
}

.login-button:active {
    transform: translateY(0);
}

/* ========================================
   Message Components
   ======================================== */

.error-message {
  background-color: #f2dede;
  border: 1px solid #ebccd1;
  color: #a94442;
}

.alertNotification {
  border-radius: 4px;
  padding: 10px 15px;
  margin: 8px !important;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 480px) {
    .login-container {
        max-width: 100%;
        gap: 30px;
    }
    
    .logo-container img {
        max-width: 150px;
    }
    
    .form-input,
    .login-button,
    .btn-primary {
        font-size: 16px;
        padding: 14px 18px;
    }
}

/* ========================================
   Utility Classes
   ======================================== */

.text-center {
    text-align: center;
}

.text-gold {
    color: var(--main-color-gold);
}

.bg-dark {
    background-color: var(--background-dark);
}

.bg-light {
    background-color: var(--background-light);
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

.gap-20 {
    gap: 20px;
}

.gap-40 {
    gap: 40px;
}

.w-100 {
    width: 100%;
}

.max-w-400 {
    max-width: 400px;
}

.flex {
    display: flex;
}

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

.align-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.position-relative {
    position: relative;
}

.z-1 {
    z-index: 1;
}

