/* Settings Drawers Styles */

/* General Settings Drawer - Standard Size */
#settingsDrawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transition: right 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #dee2e6;
}

/* Project Settings Drawer - Larger */
#projectSettingsDrawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transition: right 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #dee2e6;
}

/* Account Settings Drawer - Standard Size */
#accountSettingsDrawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transition: right 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #dee2e6;
}

    #settingsDrawer.open,
    #projectSettingsDrawer.open,
    #accountSettingsDrawer.open {
        right: 0;
    }

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    display: none;
    animation: fadeIn 0.3s ease;
}

    .drawer-overlay.show {
        display: block;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Header - styled like modal header */
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
    flex-shrink: 0;
}

    .drawer-header h5,
    .drawer-header h3 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 500;
        color: #495057;
        line-height: 1.5;
    }

    .drawer-header .btn-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #495057;
        cursor: pointer;
        padding: 0;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .drawer-header .btn-close:hover {
            color: #000;
        }

        .drawer-header .btn-close::before {
            content: "×";
        }

/* Content - styled like modal body */
.drawer-content {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    background-color: #fff;
}

/* Settings Sections */
.settings-section {
    margin-bottom: 1.5rem;
}

    .settings-section:last-child {
        margin-bottom: 1rem;
    }

/* Setting Items */
.setting-item {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

    .setting-item:hover {
        background-color: #e9ecef;
        border-color: #dee2e6;
    }

/* Two-column layout for boolean and integer settings */
.setting-item-two-column {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.setting-name {
    flex: 1;
    font-weight: 500;
    color: #495057;
    font-size: 0.875rem;
    margin: 0;
}

.setting-control {
    flex-shrink: 0;
    width: 100px;
}

/* Traditional single-column layout for string settings */
.setting-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
    font-size: 0.875rem;
}

.setting-input {
    width: 100%;
}

.setting-item .k-checkbox-label {
    margin-left: 0.5rem;
    font-weight: normal;
}

/* Footer - styled like modal footer */
.drawer-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    display: flex;
    gap: 0.75rem;
    justify-content: left;
    flex-shrink: 0;
}

    /* Button styling to match existing modals and site styling */
    .drawer-footer .k-button {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
        border-radius: 0.25rem;
        font-weight: 500;
        transition: all 0.15s ease-in-out;
    }

    .drawer-footer .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
        border-radius: 0.25rem;
        font-weight: 500;
        transition: all 0.15s ease-in-out;
    }

    /* Primary action buttons (Save) */
    .drawer-footer .k-button-solid-primary {
        color: #fff;
        background-color: rgba(40, 167, 69, 0.85);
        border-color: rgba(40, 167, 69, 0.75);
    }

        .drawer-footer .k-button-solid-primary:hover {
            color: #fff;
            background-color: rgba(40, 167, 69, 0.95);
            border-color: rgba(40, 167, 69, 0.85);
            transform: translateY(-1px);
        }

    /* Secondary action buttons (Cancel/Close) */
    .drawer-footer .k-button-solid-base {
        color: #fff;
        background-color: rgba(108, 117, 125, 0.75);
        border-color: rgba(108, 117, 125, 0.75);
    }

        .drawer-footer .k-button-solid-base:hover {
            color: #fff;
            background-color: rgba(108, 117, 125, 0.95);
            border-color: rgba(108, 117, 125, 0.85);
        }

    /* Danger action buttons (Delete) */
    .drawer-footer .k-button-solid-danger,
    .project-actions .k-button-solid-danger,
    .team-actions .k-button-solid-danger {
        color: #fff;
        background-color: rgba(220, 53, 69, 0.65);
        border-color: rgba(220, 53, 69, 0.75);
    }

        .drawer-footer .k-button-solid-danger:hover,
        .project-actions .k-button-solid-danger:hover,
        .team-actions .k-button-solid-danger:hover {
            color: #fff;
            background-color: rgba(220, 53, 69, 0.85);
            border-color: rgba(220, 53, 69, 0.85);
            transform: translateY(-1px);
        }

/* All k-button styling within drawers */
.drawer-content .k-button {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

/* Primary buttons in content areas (Add Project/Team) */
.drawer-content .k-button-solid-primary {
    color: #fff;
    background-color: rgba(0, 123, 255, 0.75);
    border-color: rgba(0, 123, 255, 0.75);
}

    .drawer-content .k-button-solid-primary:hover {
        color: #fff;
        background-color: rgba(0, 123, 255, 0.95);
        border-color: rgba(0, 123, 255, 0.85);
        transform: translateY(-1px);
    }

/* Base/secondary buttons in content areas */
.drawer-content .k-button-solid-base {
    color: #fff;
    background-color: rgba(108, 117, 125, 0.75);
    border-color: rgba(108, 117, 125, 0.75);
}

    .drawer-content .k-button-solid-base:hover {
        color: #fff;
        background-color: rgba(108, 117, 125, 0.95);
        border-color: rgba(108, 117, 125, 0.85);
        transform: translateY(-1px);
    }

/* Danger buttons in content areas */
.drawer-content .k-button-solid-danger {
    color: #fff;
    background-color: rgba(220, 53, 69, 0.65);
    border-color: rgba(220, 53, 69, 0.75);
}

    .drawer-content .k-button-solid-danger:hover {
        color: #fff;
        background-color: rgba(220, 53, 69, 0.85);
        border-color: rgba(220, 53, 69, 0.85);
        transform: translateY(-1px);
    }

/* Small button sizing */
.drawer-content .k-button-sm {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

/* Button focus styles to match site styling */
.drawer-content .k-button:focus,
.drawer-footer .k-button:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Loading state */
.drawer-content.loading {
    position: relative;
    pointer-events: none;
}

    .drawer-content.loading::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.8);
        display: flex;
        align-items: center;
        justify-content: center;
    }

/* Success/Error messages */
.settings-status {
    padding: 0.75rem 1rem;
    margin: 1.25rem 1.5rem 0rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

    .settings-status.success {
        background-color: #d1e7dd;
        border: 1px solid #badbcc;
        color: #0f5132;
    }

    .settings-status.error {
        background-color: #f8d7da;
        border: 1px solid #f5c2c7;
        color: #842029;
    }

/* Project Items */
.project-item {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.project-info {
    flex: 1;
}

.project-name {
    font-weight: 500;
    color: #495057;
    margin: 0 0 0.25rem 0;
}

.project-meta {
    font-size: 0.75rem;
    color: #6c757d;
}

.project-actions {
    display: flex;
    gap: 0.5rem;
}

/* Team Items */
.team-item {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.team-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.team-info {
    flex: 1;
}

.team-name {
    font-weight: 500;
    color: #495057;
    margin: 0 0 0.25rem 0;
}

.team-meta {
    font-size: 0.75rem;
    color: #6c757d;
}

.team-badges {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.team-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.team-actions {
    display: flex;
    gap: 0.5rem;
}

.team-members {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
}

.team-members-section {
    margin-top: 0.75rem;
}

.team-members-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .team-members-header:hover {
        background-color: #dee2e6;
    }

.team-members-title {
    font-weight: 500;
    font-size: 0.875rem;
    color: #495057;
}

.team-members-toggle {
    transition: transform 0.2s ease;
    color: #6c757d;
}

.team-members.collapsed {
    display: none;
}

.team-member {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: #495057;
    margin: 0;
}

.member-email {
    font-size: 0.75rem;
    color: #6c757d;
}

.member-type {
    font-size: 0.75rem;
    color: #6c757d;
    margin-left: 0.5rem;
}

/* Compact Name and Logo Layout */
.name-logo-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.name-column {
    flex: 1;
    min-width: 0;
}

.logo-column {
    flex: 0 0 180px;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    max-height: 165px;
    padding: 0.75rem;
}

.logo-display-compact {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.75rem;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.current-logo-compact {
    max-width: 150px;
    max-height: 85px;
    border-radius: 0.25rem;
}

.no-logo-placeholder {
    color: #6c757d;
    font-style: italic;
    font-size: 0.875rem;
    text-align: center;
}

.logo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.logo-actions-header {
    display: flex;
    gap: 0.25rem;
}

.logo-actions-compact {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* Legacy logo section (for backward compatibility) */
.logo-section {
    margin-bottom: 1.5rem;
}

.logo-display {
    text-align: center;
    margin-bottom: 1rem;
}

.current-logo {
    max-width: 200px;
    max-height: 100px;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

.logo-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.no-logo-text {
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
    text-align: center;
    border: 2px dashed #dee2e6;
    border-radius: 0.375rem;
}

/* Horizontal separator */
.drawer-separator {
    border: none;
    border-top: 1px solid #6c757d;
    height: 1px;
    background: transparent;
    margin: 1rem 0rem 1.8rem 0rem;
}

/* Modal z-index fix */
.modal {
    z-index: 10000 !important;
}

.modal-backdrop {
    z-index: 9999 !important;
}

/* Responsive design */
@media (max-width: 768px) {
    #settingsDrawer,
    #projectSettingsDrawer,
    #accountSettingsDrawer {
        width: 100%;
        right: -100%;
    }

    .drawer-header,
    .drawer-content,
    .drawer-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .drawer-footer {
        flex-direction: column;
    }

        .drawer-footer .k-button,
        .drawer-footer .btn {
            width: 100%;
            margin-bottom: 0.5rem;
        }

    /* Stack name and logo vertically on mobile */
    .name-logo-row {
        flex-direction: column;
        gap: 1rem;
    }

    .logo-column {
        flex: none;
        width: 100%;
    }

    .logo-display-compact {
        min-height: 60px;
    }

    .current-logo-compact {
        max-width: 120px;
        max-height: 85px;
    }
}
