/* Presentation Matrix Styles */

.presentation-matrix-container {
    width: 100%;
    overflow-x: auto;
    margin: 20px 0;
}

.presentation-matrix-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    border: 1px solid #000000;
    font-family: Arial, sans-serif;
}

.presentation-matrix-table td {
    border: 1px solid #000000;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}

.presentation-matrix-table .month-label,
.presentation-matrix-table .row-label {
    background-color: #f0f0f0;
    font-weight: normal;
    text-align: left;
    padding-left: 15px;
    min-width: 150px;
    width: 150px;
}

.presentation-matrix-table .month-name-row td {
    background-color: #ffffff;
    font-weight: bold;
    padding: 10px 8px;
}

.presentation-matrix-table .date-header {
    background-color: #ffffff;
    font-weight: normal;
    padding: 8px;
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    border-top: 3px solid #000000;
    border-right: 3px solid #000000;
    border-left: 3px solid #000000;
}

.presentation-matrix-table .date-header.clickable-date-header {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.presentation-matrix-table .date-header.clickable-date-header:hover {
    background-color: #f5f5f5;
}

.presentation-matrix-table .date-header.past-event,
.presentation-box.past-event {
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.6;
}

.presentation-box.editable-presentation-box {
    cursor: pointer;
}

.presentation-matrix-table .presentation-cell {
    padding: 8px;
    vertical-align: middle;
    border-right: 3px solid #000000;
    border-left: 3px solid #000000;
    width: 150px;
    min-width: 150px;
    max-width: 150px;
}

.presentation-matrix-table .topic-cell {
    padding: 8px;
    vertical-align: middle;
    border-bottom: 3px solid #000000;
    border-right: 3px solid #000000;
    border-left: 3px solid #000000;
    width: 150px;
    min-width: 150px;
    max-width: 150px;
}

.presentation-box {
    min-width: 100px;
    min-height: 40px;
    padding: 8px;
    border: 2px solid #000000;
    background-color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.presentation-box.has-user:hover {
    background-color: #da10ae;
}

.presentation-box.has-user {
    background-color: #ffffff;
}

.presentation-box.empty {
    background-color: #ffffff;
    border: 1px solid #000000;
}

.presentation-box.selected {
    background-color: #da10ae;
    border-color: #da10ae;
    border-width: 2px;
}

.presentation-box.selected .box-user {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* User1 selection (current user's event) - Blue color */
.presentation-box.user1-selected {
    background-color: #2196F3;
    border-color: #1976D2;
    border-width: 3px;
}

.presentation-box.user1-selected .box-user {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

.presentation-box.user1-selected:hover {
    background-color: #1976D2;
}

/* User2 selection (other user's event) - Green color */
.presentation-box.user2-selected {
    background-color: #4CAF50;
    border-color: #388E3C;
    border-width: 3px;
}

.presentation-box.user2-selected .box-user {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

.presentation-box.user2-selected:hover {
    background-color: #388E3C;
}

/* Status colors for presentation boxes */
.presentation-box.status-accepted {
    background-color: #4caf50;
}

.presentation-box.status-accepted:hover {
    background-color: #45a049;
}

.presentation-box.status-accepted .box-user {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.presentation-box.status-review {
    background-color: #ff9800;
}

.presentation-box.status-review:hover {
    background-color: #f57c00;
}

.presentation-box.status-review .box-user {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.presentation-box.status-rejected {
    background-color: #f44336;
}

.presentation-box.status-rejected:hover {
    background-color: #da190b;
}

.presentation-box.status-rejected .box-user {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.presentation-box.status-init {
    /*background-color: #ff9800;*/
    background-color: #03a9f4;
}

.presentation-box.status-init:hover {
    /*background-color: #f57c00;*/
    background-color: #0288d1;
}

.presentation-box.status-init .box-user {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.presentation-box.status-review_admin {
    background-color: #ffffff;
    border: 2px solid #000000;
}

.presentation-box.status-review_admin:hover {
    background-color: #9c27b0;
}

.presentation-box.status-review_admin:hover .box-user {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.presentation-box.status-review_admin .box-user {
    color: #000000;
}

.presentation-box .box-user {
    font-size: 14px;
    color: #000000;
    font-weight: bold;
}

/* Special type presentation boxes - gray color */
.presentation-box.special-type {
    background-color: #9e9e9e !important;
    border-color: #757575 !important;
}

.presentation-box.special-type:hover {
    background-color: #757575 !important;
}

.presentation-box.special-type .box-user {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

.presentation-box.special-type.selected,
.presentation-box.special-type.user1-selected,
.presentation-box.special-type.user2-selected {
    background-color: #616161 !important;
    border-color: #424242 !important;
}

.presentation-box .box-empty-text {
    font-size: 12px;
    color: #666666;
    font-style: italic;
    text-align: center;
}

.presentation-box.empty-presentation-box {
    cursor: pointer;
}

.presentation-box.empty-presentation-box:hover {
    background-color: #f5f5f5;
}

.topic-box {
    width: 100%;
    min-height: 40px;
    height: 40px;
    padding: 8px;
    border: 1px solid #000000;
    background-color: #ffffff;
    display: block;
    position: relative;
    overflow: visible;
    box-sizing: border-box;
}

.topic-box .topic-text {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    color: #000000;
    line-height: 24px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    text-align: left;
}

.topic-box .topic-tooltip {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background-color: #ffffff;
    border: 1px solid #000000;
    font-size: 14px;
    color: #000000;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: scaleY(0);
    transform-origin: top;
    white-space: normal;
    word-wrap: break-word;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.4;
    min-width: 100%;
    max-width: 400px;
    max-height: 200px;
    overflow-y: auto;
    box-sizing: border-box;
    min-height: 40px;
}

.topic-box:hover .topic-tooltip {
    opacity: 1;
    pointer-events: auto;
    transform: scaleY(1);
}

.topic-cell {
    position: relative;
}

.topic-cell:hover {
    z-index: 1001;
}

/* Modal Styles */
.presentation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #ffffff;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 100001;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
}

.modal-close:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    margin: 0 0 15px 0;
}

.swap-details,
.create-details {
    margin-top: 15px;
}

.swap-item,
.create-item {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.swap-item strong,
.create-item strong {
    display: block;
    margin-bottom: 5px;
}

.swap-date,
.swap-user,
.create-date {
    display: block;
    margin-top: 5px;
    color: #333;
}

.swap-user {
    font-weight: 600;
}

.create-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.user-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.topic-textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    resize: vertical;
    box-sizing: border-box;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-field .form-value {
    padding: 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 5px;
}

.form-field .form-value-date {
    padding: 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-footer .button {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    border: 1px solid #ddd;
    transition: background-color 0.2s ease;
}

.modal-footer .button-secondary {
    background-color: #f5f5f5;
    color: #333;
}

.modal-footer .button-secondary:hover {
    background-color: #e0e0e0;
}

.modal-footer .button-primary {
    background-color: #0073aa;
    color: #ffffff;
    border-color: #0073aa;
}

.modal-footer .button-primary:hover {
    background-color: #005a87;
}

.modal-footer .button-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    border-color: #ccc;
}

.modal-footer .button-danger {
    background-color: #dc3232;
    color: #ffffff;
    border-color: #dc3232;
}

.modal-footer .button-danger:hover {
    background-color: #b52727;
}

.modal-footer .button-danger:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    border-color: #ccc;
}

.modal-footer .button-warning {
    background-color: #f0ad4e;
    color: #ffffff;
    border-color: #f0ad4e;
    margin-left: 10px;
}

.modal-footer .button-warning:hover {
    background-color: #ec971f;
}

.modal-footer .button-warning:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    border-color: #ccc;
}

/* Loading overlay */
.presentation-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.presentation-loading p {
    margin-top: 15px;
    color: #333;
    font-size: 16px;
}

/* -------------------------------------------------------------------------
   Legend / Instructions
   ------------------------------------------------------------------------- */

.presentation-matrix-legend {
    margin: 0 0 20px 0;
}

.pm-legend-section {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
}

.pm-legend-section > summary {
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    list-style: none;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pm-legend-section > summary::-webkit-details-marker {
    display: none;
}

.pm-legend-section > summary::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid #555;
    border-bottom: 2px solid #555;
    transform: rotate(-45deg);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.pm-legend-section[open] > summary::before {
    transform: rotate(45deg);
}

.pm-legend-content {
    padding: 4px 16px 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.pm-legend-content h4 {
    margin: 16px 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: #222;
}

.pm-legend-content h4:first-child {
    margin-top: 8px;
}

.pm-legend-content ol,
.pm-legend-content ul {
    margin: 0 0 8px 20px;
    padding: 0;
}

.pm-legend-content li {
    margin-bottom: 4px;
}

.pm-legend-content p {
    margin: 0 0 8px;
}

.pm-legend-minibox {
    display: inline-block;
    padding: 3px 8px;
    border: 2px solid #000;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
    vertical-align: middle;
    margin-right: 4px;
    flex-shrink: 0;
    border-radius: 2px;
}

.pm-minibox-blue         { background-color: #2196F3; border-color: #1976D2; border-width: 3px; }
.pm-minibox-green        { background-color: #4CAF50; border-color: #388E3C; border-width: 3px; }
.pm-minibox-init         { background-color: #03a9f4; }
.pm-minibox-accepted     { background-color: #4caf50; }
.pm-minibox-rejected     { background-color: #f44336; }
.pm-minibox-review       { background-color: #ff9800; }
.pm-minibox-review-admin { background-color: #ffffff; border: 2px solid #000000; color: #000000; text-shadow: none; cursor: default; transition: background-color 0.2s ease, color 0.2s ease; }
.pm-minibox-review-admin:hover { background-color: #9c27b0; color: #ffffff; }
.pm-minibox-past         { background-color: #bdbdbd; border-color: #9e9e9e; opacity: 0.7; color: #333; text-shadow: none; }

.pm-legend-status-list {
    list-style: none !important;
    margin-left: 0 !important;
}

.pm-legend-status-list li {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

/* Responsive */
@media (max-width: 768px) {
    .presentation-matrix-container {
        overflow-x: auto;
    }
    
    .presentation-matrix-table {
        min-width: 600px;
    }
    
    .modal-content {
        width: 95%;
        max-width: none;
    }
}

