/**
 * Modal Styles
 *
 * Styles for task detail and completion modals
 *
 * @package HotelHub_Management_Tasks
 */

/* ========================================================================
   Modal Base
   ======================================================================== */

.hhmgt-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hhmgt-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    animation: hhmgt-fade-in 0.2s ease-out;
}

@keyframes hhmgt-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.hhmgt-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: hhmgt-slide-up 0.3s ease-out;
}

@keyframes hhmgt-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hhmgt-modal-small .hhmgt-modal-content {
    max-width: 500px;
}

/* ========================================================================
   Modal Header
   ======================================================================== */

.hhmgt-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.hhmgt-modal-header-content {
    flex: 1;
    min-width: 0;
}

.hhmgt-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.hhmgt-header-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    margin-top: 4px;
}

.hhmgt-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 12px;
}

.hhmgt-modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.hhmgt-modal-close .material-symbols-outlined {
    font-size: 24px;
}

/* ========================================================================
   Modal Body
   ======================================================================== */

.hhmgt-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.hhmgt-modal-section {
    margin-bottom: 24px;
}

.hhmgt-modal-section:last-child {
    margin-bottom: 0;
}

.hhmgt-modal-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hhmgt-modal-description {
    font-size: 15px;
    line-height: 1.6;
    color: #4b5563;
    white-space: pre-wrap;
}

/* ========================================================================
   Photo Gallery
   ======================================================================== */

.hhmgt-photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.hhmgt-photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e5e7eb;
    transition: all 0.2s;
}

.hhmgt-photo-item:hover {
    border-color: #10b981;
    transform: scale(1.05);
}

.hhmgt-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hhmgt-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #9ca3af;
    font-size: 48px;
}

/* ========================================================================
   Completion Reminder
   ======================================================================== */

.hhmgt-completion-reminder {
    background: #fef3c7;
    border: 2px solid #fbbf24;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.hhmgt-completion-reminder-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #92400e;
    font-weight: 600;
    margin-bottom: 8px;
}

.hhmgt-completion-reminder-icon .material-symbols-outlined {
    font-size: 20px;
}

.hhmgt-completion-reminder-text {
    color: #78350f;
    font-size: 14px;
    line-height: 1.5;
}

/* Compact reminder (above action buttons) */
.hhmgt-completion-reminder-compact {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 10px;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #92400e;
    line-height: 1.4;
}

.hhmgt-completion-reminder-compact .material-symbols-outlined {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.hhmgt-actions-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
    margin-top: 8px;
}

.hhmgt-acknowledgment {
    margin-top: 16px;
    padding: 12px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #fbbf24;
}

.hhmgt-acknowledgment-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #92400e;
}

.hhmgt-acknowledgment-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ========================================================================
   Completion Modal - Reminder
   ======================================================================== */

.hhmgt-reminder-modal-content {
    text-align: center;
    padding: 16px 0;
}

.hhmgt-reminder-modal-icon {
    margin-bottom: 16px;
}

.hhmgt-reminder-modal-icon .material-symbols-outlined {
    font-size: 48px;
    color: #f59e0b;
}

.hhmgt-reminder-modal-text {
    font-size: 16px;
    color: #374151;
    line-height: 1.6;
    margin: 0;
}

/* ========================================================================
   Completion Modal - Photo Upload
   ======================================================================== */

.hhmgt-photo-upload-content {
    padding: 8px 0;
}

.hhmgt-photo-upload-info {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 16px 0;
    text-align: center;
}

.hhmgt-photo-upload-area {
    margin-bottom: 16px;
}

.hhmgt-btn-full {
    width: 100%;
    justify-content: center;
}

.hhmgt-photo-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.hhmgt-photo-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
}

.hhmgt-photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hhmgt-photo-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.hhmgt-photo-remove .material-symbols-outlined {
    font-size: 16px;
}

.hhmgt-photo-remove:hover {
    background: rgba(220, 38, 38, 0.8);
}

.hhmgt-photo-error {
    color: #dc2626;
    font-size: 13px;
    margin: 8px 0 0 0;
    text-align: center;
}

/* ========================================================================
   Completion Photos Display (Task Modal)
   ======================================================================== */

.hhmgt-completion-photos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hhmgt-completion-photo-thumb {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e5e7eb;
    transition: all 0.2s;
}

.hhmgt-completion-photo-thumb:hover {
    border-color: #3b82f6;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hhmgt-completion-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hhmgt-completion-photo-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.9);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1;
}

.hhmgt-completion-photo-thumb:hover .hhmgt-completion-photo-delete {
    opacity: 1;
}

.hhmgt-completion-photo-delete .material-symbols-outlined {
    font-size: 14px;
}

.hhmgt-completion-photo-delete:hover {
    background: #dc2626;
}

/* ========================================================================
   Lightbox
   ======================================================================== */

.hhmgt-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.hhmgt-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.hhmgt-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.hhmgt-lightbox-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.hhmgt-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hhmgt-lightbox-close .material-symbols-outlined {
    font-size: 32px;
}

.hhmgt-lightbox-close:hover {
    color: #f87171;
}

.hhmgt-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 16px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.hhmgt-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hhmgt-lightbox-nav.prev {
    left: -60px;
}

.hhmgt-lightbox-nav.next {
    right: -60px;
}

.hhmgt-lightbox-nav .material-symbols-outlined {
    font-size: 32px;
}

.hhmgt-lightbox-counter {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
}

/* Mobile lightbox adjustments */
@media (max-width: 768px) {
    .hhmgt-lightbox-nav.prev {
        left: 10px;
    }

    .hhmgt-lightbox-nav.next {
        right: 10px;
    }

    .hhmgt-lightbox-close {
        top: 10px;
        right: 10px;
        position: fixed;
    }

    .hhmgt-lightbox-counter {
        bottom: 20px;
        position: fixed;
    }
}

/* ========================================================================
   Modal Actions
   ======================================================================== */

.hhmgt-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.hhmgt-modal-actions .hhmgt-btn {
    min-width: 100px;
}

/* Rotating spinner animation */
@keyframes rotating {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rotating {
    animation: rotating 1s linear infinite;
}

/* ========================================================================
   Status Buttons
   ======================================================================== */

.hhmgt-status-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hhmgt-status-btn {
    flex: 1;
    min-width: 100px;
    padding: 10px 16px;
    border: 2px solid;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.hhmgt-status-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hhmgt-status-btn.active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ========================================================================
   Notes
   ======================================================================== */

.hhmgt-notes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hhmgt-note-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
}

.hhmgt-note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.hhmgt-note-author {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.hhmgt-note-date {
    font-size: 12px;
    color: #6b7280;
}

.hhmgt-note-text {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 8px;
}

.hhmgt-note-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.hhmgt-note-carry-forward {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #10b981;
    margin-top: 8px;
}

.hhmgt-note-carry-forward .material-symbols-outlined {
    font-size: 16px;
}

/* ========================================================================
   Add Note Form
   ======================================================================== */

.hhmgt-add-note-form {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
}

.hhmgt-note-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 12px;
}

.hhmgt-note-textarea:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.hhmgt-note-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.hhmgt-carry-forward-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
}

.hhmgt-carry-forward-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ========================================================================
   Photo Upload
   ======================================================================== */

.hhmgt-photo-upload {
    margin-top: 12px;
}

.hhmgt-photo-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s;
}

.hhmgt-photo-upload-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.hhmgt-photo-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.hhmgt-photo-preview {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.hhmgt-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hhmgt-photo-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

/* ========================================================================
   Modal Footer
   ======================================================================== */

.hhmgt-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

/* ========================================================================
   Photo Lightbox
   ======================================================================== */

.hhmgt-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20000;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hhmgt-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 24px;
    transition: background 0.2s;
}

.hhmgt-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hhmgt-lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.hhmgt-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 24px;
    transition: background 0.2s;
}

.hhmgt-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hhmgt-lightbox-prev {
    left: 20px;
}

.hhmgt-lightbox-next {
    right: 20px;
}

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

@media screen and (max-width: 768px) {
    .hhmgt-modal {
        padding: 10px;
    }

    .hhmgt-modal-content {
        max-height: 95vh;
        border-radius: 8px;
    }

    .hhmgt-modal-header,
    .hhmgt-modal-body,
    .hhmgt-modal-footer {
        padding: 16px;
    }

    .hhmgt-photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .hhmgt-status-buttons {
        flex-direction: column;
    }

    .hhmgt-status-btn {
        min-width: auto;
    }
}
