/* Task Creation Section Styles */
.ic-creation-section {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
    height: 600px;
}

/* Hide entire creation section in edited view */
.edited-view .ic-creation-section {
    display: none;
}

/* Hide task creation in edited view */
.edited-view .ic-task-area {
    display: none;
}

/* Task details button */
.ic-task-details-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ic-gallery-item:hover .ic-task-details-button {
    opacity: 1;
}

.ic-task-details-button:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Show task creation only in original view */
.original-view .ic-task-area {
    display: block;
}

.ic-task-area {
    flex: 1;
    min-width: 0;
}

.ic-task-creation-form {
    background-color: #f8f9fa;
    border: 2px solid #6c757d;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.ic-task-creation-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #23282d;
    font-size: 1.3em;
    padding: 5px 10px;
    background-color: #6c757d;
    color: white;
    border-radius: 4px;
    display: inline-block;
}

/* Task Form Elements */
.ic-form-group {
    margin-bottom: 15px;
    width: 100%;
    box-sizing: border-box;
}

.ic-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #23282d;
}

.ic-form-group input[type="text"],
.ic-form-group input[type="date"],
.ic-form-group select,
.ic-form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    box-sizing: border-box;
    max-width: 100%;
}

.ic-form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.ic-form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 15px;
    border-top: 1px solid #eee;
}

.ic-form-actions button,
.ic-form-actions .button {
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ic-form-actions .button-primary {
    background: #2271b1;
    color: #fff;
}

.ic-form-actions .button-primary:hover {
    background: #135e96;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ic-form-actions .button-secondary {
    background: #f8f9fa;
    color: #2c3338;
    border: 1px solid #ddd;
}

.ic-form-actions .button-secondary:hover {
    background: #f0f0f1;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#ic-standalone-task-form {
    width: 100%;
    box-sizing: border-box;
}

/* Task Display in Gallery */
.ic-gallery-item[data-post-type="ic_task"] {
    display: flex;
    gap: 15px;
    padding: 15px;
}

.ic-gallery-item[data-post-type="ic_task"] .ic-gallery-item-content {
    flex: 1;
    min-width: 0;
}

.ic-gallery-item[data-post-type="ic_task"] .ic-gallery-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #23282d;
    margin: 0 0 8px;
}

.ic-task-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    height: 150px;
    width: 150px;
    border-radius: 4px;
    margin: 0 auto;
}

.ic-task-preview .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #6c757d;
}

.ic-task-description {
    font-size: 14px;
    color: black;
    margin: 10px 0;
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
    background-color: white;
}

.ic-task-description::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 20px;
    background: linear-gradient(transparent, #fff);
}

/* Task Metadata */
.ic-task-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.ic-task-due-date {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ic-task-assignee {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: #495057;
}

.ic-task-assignee img {
    border-radius: 50%;
    width: 20px;
    height: 20px;
}

/* Form Loading State */
.ic-form-loading {
    position: relative;
}

.ic-form-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.ic-form-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 2;
}

/* Select2 Customization */
.select2-container--default .select2-selection--single {
    border: 1px solid #ddd;
    border-radius: 4px;
    height: 38px;
    padding: 4px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #0073aa;
}

/* Responsive Styles */
@media screen and (max-width: 782px) {
    .ic-creation-section {
        flex-direction: column;
    }

    .ic-task-area {
        width: 100%;
    }

    .ic-task-creation-form {
        margin-top: 20px;
    }
}

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

/* Task Details Modal */
.ic-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.ic-modal.active {
    display: flex;
}

.ic-modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    position: relative;
    display: grid;
    grid-template-columns: 1fr 350px;
    overflow: hidden;
}

.ic-modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    cursor: pointer;
    font-size: 24px;
    color: #666;
    background: none;
    border: none;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ic-modal-close:hover {
    color: #135e96;
    transform: rotate(90deg);
}

.ic-task-details-container {
    padding: 30px;
    overflow-y: auto;
    max-height: 90vh;
}

.ic-task-title {
    margin: 0 0 20px;
    padding-right: 30px;
    font-size: 24px;
    color: #1d2327;
    font-weight: 600;
}

.ic-task-meta-info {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.ic-task-status-section {
    width: 100%;
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.ic-task-status-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ic-task-status-button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    border: 2px solid #000;
    border-radius: 15px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    color: white;
    white-space: nowrap;
    position: relative;
}

.ic-task-status-button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.ic-task-status-button.pending {
    background: #dc3545;
}

.ic-task-status-button.pending:hover {
    background: #c82333;
}

.ic-task-status-button.in-progress {
    background: #ffc107;
    color: #000;
}

.ic-task-status-button.in-progress:hover {
    background: #e0a800;
}

.ic-task-status-button.completed {
    background: #28a745;
}

.ic-task-status-button.completed:hover {
    background: #218838;
}

.ic-task-status-button.active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #000;
    transform: scale(1.05);
}

.ic-task-status-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ic-task-status-button.active:hover {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #000, 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ic-task-due-date,
.ic-task-assignee {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    color: #666;
}

.ic-task-assignee img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.ic-task-description-full {
    margin-bottom: 30px;
    line-height: 1.6;
    color: #2c3338;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.ic-task-comments-section {
    background: #f8f9fa;
    border-left: 1px solid #eee;
    padding: 30px;
    overflow-y: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.ic-task-comments-section h3 {
    margin: 0 0 20px;
    font-size: 18px;
    color: #1d2327;
    display: flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    background: #f8f9fa;
    padding: 10px 0;
    z-index: 1;
}

.ic-task-comments-section h3 .dashicons {
    color: #666;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.ic-task-comments-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

.ic-task-comment {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ic-task-comment-meta {
    margin-bottom: 8px;
    color: #666;
}

.ic-task-comment-content {
    color: #2c3338;
    line-height: 1.6;
}

.ic-task-comment-form {
    position: sticky;
    bottom: 0;
    background: #f8f9fa;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.ic-task-comment-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    margin-bottom: 10px;
    background: #fff;
}

.ic-task-comment-submit {
    width: 100%;
    padding: 8px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ic-task-comment-submit:hover {
    background: #135e96;
}

.ic-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

@media screen and (max-width: 782px) {
    .ic-modal-content {
        grid-template-columns: 1fr;
        max-height: none;
        height: 100vh;
    }

    .ic-task-details-container,
    .ic-task-comments-section {
        max-height: none;
    }

    .ic-task-comments-section {
        border-left: none;
        border-top: 1px solid #eee;
    }
}
