﻿/* Exact CRM Modal Style from Image */
:root {
    --bg-modal: #FFFFFF;
    --bg-input: #E6E8EA;
    --accent-blue: #006AF5;
    --text-primary: #595C5D;
    --text-secondary: ACABAA;
    --border-color: #E3E3E3;
    --radius: 10px;
}

[data-theme-mode=dark] {
    --bg-modal: #2a2a2a;
    --bg-input: #000000;
    --accent-blue: #0076ff;
    --text-primary: #ffffff;
    --text-secondary: #bfbfbf;
    --border-color: #222222;
    --radius: 10px;
}



.task-modal .modal-container {
    background-color: var(--bg-modal);
    width: 480px;
    max-height: 90vh;
    /* Fixed height to enable scrolling */
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    margin: 30px 0;
    /* Margin on top and bottom */
    overflow: hidden;
}

.task-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px 24px;
    flex-shrink: 0;
    z-index: 10;
}

    .task-modal .modal-header h1 {
        font-size: 1.1rem;
        font-weight: 600;
    }

.task-modal .close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
}

.task-modal .modal-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 24px 24px 24px;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

    .task-modal .modal-body::-webkit-scrollbar {
        width: 6px;
    }

    .task-modal .modal-body::-webkit-scrollbar-thumb {
        background: #333;
        border-radius: 10px;
    }
/* Timing Pills */
.task-modal .timing-toggles {
    display: flex;
    background: var(--bg-modal);
    padding: 4px;
    border-radius: 10px;
    width: fit-content;
}

.task-modal .timing-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.2s;
}

    .task-modal .timing-btn.active {
        background: var(--accent-blue);
        color: white;
    }

.task-modal .hidden {
    display: none !important;
}
/* Sub Tabs (Scheduled, Unscheduled, Repeat) */
.task-modal .sub-tabs-container {
    display: flex;
    background: transparent;
    /* Remove container bg for better gap visibility */
    padding: 0;
    margin-bottom: 24px;
    width: fit-content;
    gap: 12px;
    /* Increased gap as requested */
}

.task-modal .sub-tab-btn {
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    background: #1b1b1b;
    /* Default pill bg */
    color: var(--text-secondary);
    transition: all 0.2s;
}

    .task-modal .sub-tab-btn.active {
        background: #252528;
        /* Active pill bg */
        color: var(--accent-blue);
    }
/* Date Time Section */
.task-modal .date-time-box {
    background: #141414;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.task-modal .dt-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.task-modal .dt-input-group {
    flex: 1;
    background: rgb(10, 10, 10);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ccc;
    font-size: 0.85rem;
    position: relative;
    /* Fixed for absolute child */
}

    .task-modal .dt-input-group i {
        color: var(--accent-blue);
        font-size: 1rem;
        pointer-events: none;
        /* Let clicks pass through to the input */
    }

    .task-modal .dt-input-group.icon-right {
        justify-content: space-between;
    }

        .task-modal .dt-input-group.icon-right i {
            color: #555;
            /* Muted icon for repeat section */
        }

    .task-modal .dt-input-group input {
        background: transparent;
        border: none;
        color: white;
        font-family: inherit;
        font-size: 0.85rem;
        width: 100%;
        outline: none;
        cursor: pointer;
        color-scheme: dark;
        /* Ensures the picker menu is dark */
    }
        /* Hide default browser icons but keep functionality */
        .task-modal .dt-input-group input::-webkit-calendar-picker-indicator {
            background: transparent;
            bottom: 0;
            color: transparent;
            cursor: pointer;
            height: auto;
            left: 0;
            position: absolute;
            right: 0;
            top: 0;
            width: auto;
        }
/* Form Styles */
.task-modal .form-group {
    margin-bottom: 20px;
}

.task-modal .label-text {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.05rem;
}

.task-modal .form-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.05rem;
}

.task-modal .input-field {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 12px 14px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    outline: none;
}

    .task-modal .input-field::placeholder {
        color: #555;
    }

    .task-modal .input-field:focus {
        border-color: #333;
    }

.task-modal .row {
    display: flex;
    gap: 12px;
}

.task-modal .col-half {
    flex: 1;
}
/* Select Styling */
.task-modal .select-wrapper {
    position: relative;
}

    .task-modal .select-wrapper i {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-secondary);
        font-size: 0.8rem;
        pointer-events: none;
    }

.task-modal .select-field {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 12px 14px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
}
/* Deadline Toggle */
.task-modal .deadline-box {
    background: var(--bg-input);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
}

.task-modal .deadline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.task-modal .toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

    .task-modal .toggle-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.task-modal .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 34px;
}

    .task-modal .slider:before {
        position: absolute;
        content: "";
        height: 14px;
        width: 14px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: .4s;
        border-radius: 50%;
    }

.task-modal input:checked + .slider {
    background-color: var(--accent-blue);
}

    .task-modal input:checked + .slider:before {
        transform: translateX(16px);
    }

.task-modal .deadline-display {
    background: #000;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #ccc;
}
/* Hosts / Participants Section */
.task-modal .hosts-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.task-modal .avatar-stack {
    display: flex;
    align-items: center;
}

.task-modal .avatar-item {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 2px solid var(--bg-modal);
    margin-right: -15px;
    /* Significant overlap */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #ccc;
    background: #222;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

    .task-modal .avatar-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    /* Overlap order: right elements on top */
    .task-modal .avatar-item:nth-child(2) {
        z-index: 2;
    }

    .task-modal .avatar-item:nth-child(3) {
        z-index: 3;
    }

    .task-modal .avatar-item:nth-child(4) {
        z-index: 4;
    }

.task-modal .add-host-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px dashed #333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    cursor: pointer;
    background: transparent;
    transition: all 0.2s;
}

    .task-modal .add-host-btn:hover {
        border-color: var(--accent-blue);
        color: white;
    }

.task-modal .add-participants-banner {
    background: #000;
    border-radius: 12px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: border 0.2s;
}

    .task-modal .add-participants-banner:hover {
        border-color: #222;
    }

.task-modal .banner-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid #222;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 0.9rem;
}

.task-modal .add-participants-banner span {
    font-size: 0.85rem;
    font-weight: 500;
    color: #ccc;
}
/* Description */
.task-modal .textarea-field {
    width: 100%;
    height: 80px;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 12px;
    color: white;
    font-size: 0.85rem;
    resize: none;
    outline: none;
}
/* Footer Group */
.task-modal .footer-inputs {
    margin-top: 12px;
}

.task-modal .icon-input {
    position: relative;
    display: flex;
    align-items: center;
}

    .task-modal .icon-input i {
        position: absolute;
        left: 12px;
        color: #666;
        font-size: 0.9rem;
    }

    .task-modal .icon-input input {
        padding-left: 36px;
        background: #000;
    }
/* Modal Footer */
.task-modal .modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: #141414;
    /* Slightly different bg to distinguish fixed footer */
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.task-modal .clear-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
}

.task-modal .save-btn {
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 118, 255, 0.3);
}

    .task-modal .save-btn:hover {
        background: #0069e6;
    }
