/* --- General Body & Layout --- */
body {
    font-family: Arial, Helvetica, sans-serif;
    color: #000;
    background-color: #fff;
    margin: 0;
    font-size: 14px;
}
#MainBody { padding: 20px 0; }
.content-wrapper {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}
table { width: 100%; border-collapse: collapse; }
h2 {
    font-weight: normal;
    font-size: 20px;
    text-align: center;
    margin-top: 0;
    margin-bottom: 10px;
}
select {
    border: 1px solid #767676;
    padding: 1px;
    font-size: 12px;
}

/* --- Header --- */
#MenuTop {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0 20px;
}
.header-content {
    display: flex;
    align-items: center;
    height: 60px;
    max-width: 960px;
    margin: 0 auto;
}
.logo-area h1 { margin: 0; font-size: 24px; color: #333; }
.logo-area a {
    text-decoration: none;
    color: inherit;
}

.divider { margin: 0 15px; font-size: 24px; color: #ccc; }
.nav-links a { text-decoration: none; color: #007bff; font-size: 18px; padding: 5px 10px; }
.nav-links a:hover { text-decoration: underline; }
.nav-links a.selected { font-weight: bold; color: #0056b3; }

/* --- index.html specific styles --- */
td.left-column, td.right-column { vertical-align: top; text-align: center; }
td.left-column { width: 350px; }
#NewEventNameDiv { text-align: center; margin: 20px 0 40px 0; }
#NewEventName { font-size: 22px; text-align: center; padding: 5px; border: 1px solid #000; }
.help-text { font-size: 12px; line-height: 1.5; margin: 10px 0; }

/* --- Calendar Styles --- */
#Calendar { font-size: 14px; margin: 10px auto 0 auto; width: 281px; user-select: none; }
#Calendar * { box-sizing: border-box; }
.calendar-header, .calendar-row { clear: both; height: 22px; }
.month-label, .year-label { float: left; width: 60px; padding: 4px 5px; line-height: 1.0; cursor: grab; }
.month-label { text-align: right; }
.year-label { text-align: left; }
.calendar-header { padding-left: 60px; }
.calendar-header div { float: left; width: 21px; margin: 0 1px; padding-top: 2px; text-align: center; cursor: grab; }
.day-cell { float: left; width: 21px; height: 20px; line-height: 16px; margin: 0 1px; border: 1px solid black; cursor: pointer; background-color: #ffdede; text-align: center; padding: 0; }
.day-cell.selected { background-color: green; color: white; }

/* --- Day of Week Picker --- */
#DaysOfWeekPicker { width: 200px; margin: 10px auto 0 auto; user-select: none; }
#DaysOfWeekPicker .dow-header { display: flex; justify-content: center; margin-left: -1px; }
#DaysOfWeekPicker .dow-header div { width: 23px; text-align: center; font-size: 14px; }
#DaysOfWeekPicker .dow-body { display: flex; justify-content: center; }
.dow-cell { width: 21px; height: 150px; margin: 0 1px; border: 1px solid black; background-color: #ffdede; cursor: pointer; box-sizing: border-box; }
.dow-cell.selected { background-color: green; }

/* --- Buttons and Right Column --- */
#TodayButton, #CreateEventButton { border: 1px solid #767676; background-color: #f0f0f0; padding: 2px 6px; font-size: 12px; margin-top: 10px; color: #000;}
.right-column .time-select-group { margin: 15px 0; font-size: 14px; }

/* --- event.html specific styles --- */
.header-info { margin-bottom: 20px; text-align: center; }
.event-page-container { display: flex; justify-content: space-between; gap: 30px; }
.signin-column { width: 250px; flex-shrink: 0; }
.availability-column { flex-grow: 1; }
.availability-grid { overflow-x: auto; }
#GroupAvailabilityGrid, #MyAvailabilityGrid { border-collapse: collapse; table-layout: fixed; }
#GroupAvailabilityGrid th, #MyAvailabilityGrid th { font-weight: normal; font-size: 12px; padding: 4px; min-width: 45px; }
#MyAvailabilityGrid td, #GroupAvailabilityGrid td { border: 1px solid #ccc; }
.time-header-cell { width: 60px; height: 12px; border: none !important; text-align: right; font-size: 10px; padding-right: 5px; vertical-align: top; white-space: nowrap; }
.timeslot { height: 12px; background-color: #ffdede; }
#MyAvailabilityGrid .timeslot { cursor: pointer; }
#MyAvailabilityGrid .timeslot.available { background-color: green; }
.availability-legend { margin-top: 10px; font-size: 12px; }
.legend-box { display: inline-block; width: 12px; height: 12px; border: 1px solid #000; vertical-align: middle; margin-right: 5px; }
.availability-header { text-align: center; font-size: 16px; margin-bottom: 10px; }
#tooltip { position: absolute; display: none; background-color: #fff; border: 1px solid #000; padding: 5px; font-size: 12px; pointer-events: none; z-index: 1000; }
.corner-cell { border: none !important; background-color: transparent; }
.my-grid-wrapper { position: relative; margin-top: 10px; }
.grid-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(255, 255, 255, 0.8); z-index: 10; cursor: not-allowed; }

/* --- Flash Messages --- */
.flashes { list-style-type: none; padding: 0; margin: 0 0 10px 0; }
.flashes li.error { padding: 8px; margin-bottom: 5px; background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; border-radius: 4px; font-size: 12px; text-align: center; }

/* --- Footer --- */
footer { background-color: #000000; color: #ffffff; padding: 30px 40px; margin-top: 40px; border-top: 1px solid #333; }
.footer-content { display: flex; justify-content: flex-start; align-items: flex-start; gap: 50px; max-width: 960px; margin: 0 auto; }
.footer-left { flex-basis: 200px; flex-shrink: 0; }
.footer-left h3, .footer-right p { margin-top: 0; }
.footer-left ul { list-style: none; padding: 0; }
.footer-left ul li a, footer a { color: #cccccc; text-decoration: none; }
.footer-left ul li a:hover, footer a:hover { text-decoration: underline; }
.footer-right { text-align: left; }

/* =================================================================== */
/* --- Responsive Styles (for screens 768px and smaller) --- */
/* =================================================================== */
@media (max-width: 768px) {
    .content-wrapper { padding: 0 15px; }
    .header-content, .footer-content { padding: 0 15px; }

    /* NEW: Make header items smaller on mobile */
    .logo-area h1 { font-size: 20px; }
    .nav-links a { font-size: 16px; }
    .divider { margin: 0 10px; }

    /* --- Responsive Form on index.html --- */
    #createEventForm table, #createEventForm tbody, #createEventForm tr, #createEventForm td { display: block; width: 100%; }
    #createEventForm td.left-column, #createEventForm td.right-column { width: auto; padding: 0; }
    #createEventForm td.left-column { margin-bottom: 40px; }
    #Calendar { margin-left: auto; margin-right: auto; }

    /* --- Responsive Layout on event.html --- */
    .event-page-container { flex-direction: column; }
    .signin-column { width: auto; margin-bottom: 40px; }

    /* --- Responsive Footer --- */
    .footer-content { flex-direction: column; align-items: flex-start; gap: 20px; }
    .footer-left, .footer-right { flex-basis: auto; width: 100%; }

    /* NEW: Add a divider line between footer sections on mobile */
    .footer-left {
        padding-bottom: 20px;
        border-bottom: 1px solid #444; /* Light grey divider */
    }
}


/* ================================================= */
/* --- NEW: Modern Sharing Button & Link Styles --- */
/* ================================================= */

.sharing-block {
    background-color: #f8f9fa; /* Light grey background */
    border: 1px solid #dee2e6; /* Light border */
    border-radius: 8px; /* Rounded corners */
    padding: 10px 10px;
    margin: 20px auto;
    max-width: 550px; /* Constrain width for a cleaner look */
}

.invite-link-container {
    display: flex;
    flex-direction: column; /* Stack text and link on top of each other */
    align-items: center;
    margin-bottom: 15px;
}

.invite-text {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
}

.link-wrapper {
    display: flex;
    align-items: center;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 6px 4px 6px 12px;
    width: 100%;
    max-width: 400px;
}

#eventLink {
    font-family: monospace;
    font-size: 14px;
    color: #000;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-grow: 1; /* Allow link to take available space */
}

/* --- New Copy Button Style --- */
#copyButton {
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 5px;
    cursor: pointer;
    color: #495057;
    margin-left: 10px;
    padding: 5px 10px;
    position: relative; /* For positioning the checkmark */
    transition: background-color 0.2s;
}
#copyButton:hover {
    background-color: #dee2e6;
}
#copyButton .copy-success {
    display: none; /* Hide checkmark by default */
    color: #28a745; /* Green */
}
#copyButton.copied .copy-icon {
    display: none; /* Hide copy icon on success */
}
#copyButton.copied .copy-success {
    display: inline-block; /* Show checkmark on success */
}


/* --- New Share Icon Styles --- */
.share-icons-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* Allow icons to wrap on smaller screens */
    gap: 12px;
    padding-top: 2px;
}

.share-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 30px;   /* Circle size */
    height: 30px;  /* Circle size */
    border-radius: 50%; /* Makes it a circle */
    color: #fff !important; /* White icon color */
    font-size: 20px;
    text-decoration: none;
    transition: transform 0.2s ease-in-out, opacity 0.2s;
}
.share-icon:hover {
    transform: scale(1.15); /* Enlarge on hover */
    opacity: 0.9;
}



/* --- OFFICIAL BRAND COLORS --- */
.share-icon.email     { background-color: #7f7f7f; } /* Grey */
.share-icon.whatsapp  { background-color: #25D366; }
.share-icon.facebook  { background-color: #1877F2; }
.share-icon.twitter   { background-color: #1DA1F2; }
.share-icon.linkedin  { background-color: #0A66C2; }
.share-icon.reddit    { background-color: #FF4500; }
.share-icon.telegram  { background-color: #24A1DE; }
.share-icon.tumblr    { background-color: #35465d; }