/* css/sharedEvents.css */

.shared-events-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    position: relative;
}

.shared-events-title {
    color: #fff;
    font-size: 1.5em;
    margin: 0;
}

.help-btn {
    position: absolute;
    right: 0;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 18px;
    font-weight: bold;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.help-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.help-content {
    text-align: left;
    color: #ddd;
}

.help-content h4 {
    color: #3498db;
    margin-top: 20px;
}

.help-content p {
    line-height: 1.6;
    margin-bottom: 10px;
}

.shared-events-content {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    position: relative; /* For proper scrolling context */
}

.shared-events-footer {
    padding: 15px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.shared-events-footer-btn {
    padding: 10px 20px;
    border: 1px solid #444;
    background-color: #333;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.shared-events-footer-btn:hover {
    background-color: #444;
}

/* Tabs */
.shared-events-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #444;
    justify-content: center;
}

.shared-events-tab-btn {
    padding: 10px 20px;
    cursor: pointer;
    background: none;
    border: none;
    color: #aaa;
    font-size: 1em;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.shared-events-tab-btn.active {
    color: #fff;
    border-bottom-color: #3498db;
}

/* Grid Controls */
.shared-events-grid-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.filters-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.shared-events-filter {
    width: auto;
    min-width: 200px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.shared-events-filter option {
    background-color: #555;
    color: white;
}

.shared-events-radio-inputs {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 10px;
    user-select: none;
}


.radio-input {
    display: none;
}

.radio-input:checked + .radio-tile {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    color: #fff;
    background: rgba(255, 255, 255, 0.3);
}

.radio-input:checked + .radio-tile:before {
    transform: scale(1);
    opacity: 1;
    background-color: #fff;
    border-color: #fff;
}

.radio-input:checked + .radio-tile .radio-label {
    color: #fff;
}

.radio-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: 0.15s ease;
    cursor: pointer;
    position: relative;
}

.radio-tile:before {
    content: "";
    position: absolute;
    display: block;
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background-color: transparent;
    border-radius: 50%;
    top: 0.25rem;
    left: 0.25rem;
    opacity: 0;
    transform: scale(0);
    transition: 0.25s ease;
}

.radio-tile:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.2);
}

.radio-tile:hover:before {
    transform: scale(1);
    opacity: 1;
}

.radio-icon {
    width: 2rem;
    height: 2rem;
    color: #eee;
}

.radio-input:checked + .radio-tile .radio-icon {
    color: #fff;
}

.radio-label {
    color: #fff;
    transition: 0.375s ease;
    text-align: center;
    font-size: 13px;
}


/* Event Grid & Cards */
.shared-events-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.shared-event-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s, border-color 0.3s;
    width: calc(33.333% - 20px); /* Adjust for gap */
    min-width: 280px;
    box-sizing: border-box; /* Ensure padding and border are included in the width */
}

.shared-event-card.added {
    opacity: 0.6;
    border-left: 4px solid #27ae60;
}

.shared-event-card.added .add-btn {
    background-color: #555;
    cursor: not-allowed;
}

.shared-event-card.conflict {
    border-left: 4px solid #e67e22;
}

.shared-event-card.conflict .add-btn {
    background-color: #e67e22;
    color: #fff;
}
.shared-event-card.conflict .add-btn:hover {
    background-color: #d35400;
}


.shared-event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.shared-card-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 10px;
}

.shared-card-title {
    margin: 0;
    font-size: 1.1em;
    flex-grow: 1;
    color: #fff;
}

.shared-card-checkbox {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.shared-card-content {
    font-size: 0.9em;
    color: #ccc;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.shared-card-placeholders {
    font-size: 0.8em;
    color: #999;
    list-style: none;
    padding-left: 0;
    margin-bottom: 15px;
    flex-grow: 1; /* Allow this to take up space */
}

.shared-card-placeholders li {
    margin-bottom: 4px;
    color: #bbb;
}

.shared-card-uploader {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px; /* Reduced margin */
    width: 100%; /* Ensure it takes full width */
}

.uploader-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.uploader-name {
    font-size: 0.85em;
    color: #bbb;
}

.shared-card-footer {
    display: flex;
    gap: 10px;
    margin-top: auto; /* Push footer to the bottom */
}

.shared-card-btn {
    flex-grow: 1;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.2s, color 0.2s;
}

.shared-card-btn.add-btn {
    background-color: #27ae60;
    color: #fff;
}
.shared-card-btn.add-btn:hover {
    background-color: #2ecc71;
}

.shared-events-empty {
    text-align: center;
    grid-column: 1 / -1;
    padding: 40px;
    color: #888;
}

/* Admin View */
.admin-pending-list {
    list-style: none;
    padding: 0;
}

.admin-pending-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 10px;
}

.pending-item-info strong {
    margin-right: 10px;
}

.pending-item-actions {
    display: flex;
    gap: 10px;
}

.approve-btn {
    background-color: #27ae60;
    color: #fff;
}
.reject-btn {
    background-color: #c0392b;
    color: #fff;
}
.detail-btn {
    background-color: #3498db;
    color: #fff;
}


/* Detail Modal */
.shared-events-detail-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 600px;
    background: rgba(35, 35, 40, 0.9);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1002; /* Above main modal */
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: none;
    padding: 25px;
}

.shared-events-detail-modal.visible {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.shared-events-detail-modal h3 {
    margin-top: 0;
    color: #3498db;
}

.shared-events-detail-modal p {
    line-height: 1.6;
}

.shared-events-detail-modal h4 {
    margin-top: 20px;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

.shared-events-detail-modal ul {
    list-style: none;
    padding-left: 0;
}

.shared-events-detail-modal li {
    margin-bottom: 8px;
}

/* New Submission Modal Styles */
.submission-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none; /* Initially hidden */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.submission-modal {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: scale(0.8);
    transition: transform 0.3s ease;
    position: relative;
}

.submission-title {
    color: white;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.submission-description {
    text-align: center;
    color: #ccc;
    margin-bottom: 10px;
}

.submission-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 18px;
    font-weight: bold;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submission-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg) scale(1.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.submission-input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 15px;
    margin-bottom: 20px;
    box-sizing: border-box;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.submission-input:focus {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.submission-button-container {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.submission-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.submission-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.submission-btn.submit {
    background-color: rgba(46, 204, 113, 0.7);
}

.submission-btn.cancel {
    background-color: rgba(231, 76, 60, 0.7);
}

.avatar-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.avatar-input-group input {
    flex-grow: 1;
}

.avatar-preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
    margin-top: 10px;
}

#avatarPreviewImage {
    max-width: 100px;
    max-height: 100px;
    border-radius: 8px;
    border: 1px solid #555;
}


/* Conflict Modal */
.shared-events-conflict-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 700px;
    background: rgba(40, 42, 48, 0.95);
    backdrop-filter: blur(5px);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1002;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: none;
    padding: 25px;
    flex-direction: column;
    gap: 15px;
}

.shared-events-conflict-modal.visible {
    display: flex;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.conflict-modal-title {
    margin-top: 0;
    text-align: center;
    color: #e67e22;
}

.conflict-modal-subtitle {
    text-align: center;
    margin-top: -10px;
    color: #ccc;
}

.conflict-modal-comparison {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    margin-bottom: 25px;
}

.conflict-event-version {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #444;
}

.conflict-event-version h4 {
    margin-top: 0;
    border-bottom: 1px solid #555;
    padding-bottom: 8px;
    margin-bottom: 10px;
    color: #fff;
}

.conflict-detail-content {
    color: #eee;
    margin-bottom: 10px;
}

.conflict-detail-placeholders {
    list-style: none;
    padding-left: 0;
    font-size: 0.9em;
}

.conflict-detail-placeholders li {
    color: #bbb;
    margin-bottom: 5px;
}

.conflict-modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}


#managementEditView h3 {
    color: #27ae60;
}

.management-events-grid {
    max-height: 40vh;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0,0,0,0.1);
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.management-events-grid .shared-event-card {
    width: calc(50% - 15px); /* Two cards per row, adjusted for gap */
    min-width: 220px;
}

.management-event-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    margin-bottom: 8px;
}

.management-add-form {
    padding-top: 15px;
    border-top: 1px solid #444;
}

/* Styles for the new Upload Modal */
.submission-modal.wide {
    max-width: 800px; /* Wider modal for better layout */
    display: flex;
    flex-direction: column;
}

.upload-events-container {
    flex: 1; /* Takes up available space */
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Fix for flexbox overflow */
}

.upload-events-grid {
    max-height: 35vh; /* Limit height and allow scrolling */
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.upload-events-controls {
    padding: 5px 10px;
    color: #ccc;
}

.upload-event-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.upload-event-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.upload-event-checkbox {
    margin-right: 10px;
    width: 16px;
    height: 16px;
}

.upload-event-title {
    font-weight: bold;
    color: #fff;
    margin-right: 15px;
}

.upload-event-content {
    font-size: 0.9em;
    color: #bbb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-main-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.upload-list-wrapper {
    display: flex;
    gap: 20px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.upload-list-container {
    flex: 1;
    min-width: 250px; /* Minimum width before wrapping */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upload-list-title {
    text-align: center;
    color: #ddd;
    margin: 0 0 5px 0;
    font-size: 1.2em;
}

.upload-list-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.submission-btn.small {
    padding: 5px 12px;
    font-size: 13px;
    min-width: auto;
    border-radius: 15px;
}

.upload-search-container {
    margin-top: 10px;
}

.upload-search-container .submission-input {
    margin-top: 0;
    margin-bottom: 0;
}

.shared-event-card.upload-card {
    position: relative;
    cursor: pointer;
    width: 100%; /* Make cards take full width of their container */
}

.upload-card-checkbox {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.upload-user-info {
    margin-top: 20px; /* Add space above the user info section */
}


@media (max-width: 768px) {
    .shared-event-card {
        width: 95% ;
    }
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: rgba(46, 204, 113, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 1em;
    backdrop-filter: blur(5px);
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Error Modal (reusing submission styles) */
.error-modal-message {
    text-align: center;
    color: #ddd;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Hide scrollbar */
.shared-events-content::-webkit-scrollbar,
.management-events-grid::-webkit-scrollbar,
.submission-modal::-webkit-scrollbar {
    display: none;
}

.shared-events-content,
.management-events-grid,
.submission-modal,
.upload-events-grid {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Custom Scrollbar for Webkit browsers */
.upload-events-grid::-webkit-scrollbar {
    width: 8px;
}

.upload-events-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.upload-events-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.upload-events-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
