/* ============================================
   ADD ITEM DROPDOWN - NINJAONE STYLE
   ============================================ */

/* === Add Item Button === */
.add-item-dropdown-container {
    position: relative;
    display: inline-block;
}

.btn-add-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.875rem;
}

.btn-add-item:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
}

.btn-add-item:active {
    transform: scale(0.98);
}

/* === Dropdown Backdrop === */
.add-item-dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: transparent;
}

/* === Dropdown Menu === */
.add-item-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
    animation: dropdownSlideIn 0.15s ease-out;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Dropdown Header === */
.dropdown-header {
    padding: 1rem 1rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === Dropdown Back Button === */
.dropdown-back-button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1rem;
    background: none;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #111827;
    transition: background 0.15s ease;
}

.dropdown-back-button:hover {
    background: #f9fafb;
}

.dropdown-back-button i {
    color: #6b7280;
}

/* === Dropdown Sections === */
.dropdown-section {
    padding: 0.5rem 0;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0;
}

/* === Dropdown Items === */
.dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    transition: background 0.15s ease;
    text-align: left;
}

.dropdown-item:hover:not(:disabled) {
    background: #f3f4f6;
}

.dropdown-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dropdown-item i:first-child {
    width: 20px;
    color: #6b7280;
    font-size: 1rem;
}

.dropdown-item span {
    flex: 1;
}

.dropdown-item-with-arrow .fa-chevron-right {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* === Device Item Styling === */
.device-icon-container {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
}

.device-icon-main {
    font-size: 1.5rem;
    color: #374151;
}

.device-info {
    display: flex;
    flex-direction: column;
}

.device-title {
    font-weight: 500;
    color: #111827;
    font-size: 0.9375rem;
}

.device-subtitle {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 0.125rem;
}

.os-windows {
    color: #0078d4;
}

.os-linux {
    color: #fcc624;
}

.os-mac {
    color: #555555;
}

/* ============================================
   ADD COMPUTER MODAL
   ============================================ */

/* === Modal Overlay Container (CRITICAL: fullscreen covering everything) === */
.modal-overlay-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000 !important;
}

/* === Success Modal Overlay (Must break stacking context and appear above ALL other modals) === */
.success-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483647 !important; /* Maximum possible z-index */
    pointer-events: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    isolation: isolate !important; /* Create new stacking context */
}

.success-modal-overlay .modal-backdrop-custom,
.success-modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 2147483646 !important;
}

.success-modal-overlay .success-modal,
.success-modal-overlay > div:last-child {
    position: relative !important;
    z-index: 2147483647 !important;
}

/* === Modal Backdrop === */
.modal-backdrop-custom {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001 !important;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* === Modal Container === */
.add-computer-modal {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: calc(100vh - 4rem);
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: auto;
    z-index: 10002 !important;
    animation: modalSlideIn 0.25s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Modal Header === */
.modal-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.modal-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.25rem 0 0;
}

.learn-more-link {
    color: #2563eb;
    text-decoration: none;
}

.learn-more-link:hover {
    text-decoration: underline;
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-close-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

/* === Modal Body === */
.modal-body-custom {
    padding: 1.5rem;
    min-height: 350px;
}

.modal-content-layout {
    display: flex;
    gap: 2rem;
}

/* === OS Selection Sidebar === */
.os-selection-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 140px;
}

.os-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.9375rem;
    color: #374151;
}

.os-option:hover:not(.selected) {
    border-color: #d1d5db;
    background: #f9fafb;
}

.os-option.selected {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.os-icon {
    font-size: 1.25rem;
}

.windows-icon {
    color: #0078d4;
}

.mac-icon {
    color: #555555;
}

.linux-icon {
    color: #fcc624;
}

.os-option.selected .os-icon {
    color: inherit;
}

/* === Configuration Form === */
.os-configuration-form {
    flex: 1;
}

.os-configuration-form h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 1.5rem;
}

.form-group-custom {
    margin-bottom: 1.25rem;
}

.form-label-custom {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.required-asterisk {
    color: #ef4444;
}

.select-wrapper {
    position: relative;
}

.form-select-custom {
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: #374151;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    appearance: none;
    transition: all 0.15s ease;
}

.form-select-custom:hover:not(:disabled) {
    border-color: #9ca3af;
}

.form-select-custom:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-select-custom:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

.form-select-custom option:first-child {
    color: #9ca3af;
}

.select-arrow {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 0.75rem;
    pointer-events: none;
}

/* === Modal Footer === */
.modal-footer-custom {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.btn-cancel {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #2563eb;
    background: white;
    border: 1px solid #2563eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-cancel:hover {
    background: #eff6ff;
}

.btn-generate {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    background: #9ca3af;
    border: none;
    border-radius: 6px;
    cursor: not-allowed;
    transition: all 0.15s ease;
}

.btn-generate:not(:disabled) {
    background: #2563eb;
    cursor: pointer;
}

.btn-generate:not(:disabled):hover {
    background: #1d4ed8;
}

/* === Responsive === */
@media (max-width: 640px) {
    .add-computer-modal {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-content-layout {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .os-selection-sidebar {
        flex-direction: row;
        min-width: auto;
    }
    
    .os-option {
        flex: 1;
        justify-content: center;
        padding: 0.75rem;
    }
    
    .os-option span {
        display: none;
    }
    
    .os-icon {
        font-size: 1.5rem;
    }
}

/* ============================================
   INSTALLER SUCCESS MODAL - NINJAONE STYLE
   ============================================ */

.success-modal {
    position: relative;
    width: 420px;
    max-width: 90%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    z-index: 10100 !important;
    animation: successModalIn 0.2s ease-out;
}

@keyframes successModalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.success-modal-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.success-modal-header h2::before {
    content: '\f00c';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
}

.success-modal-body {
    padding: 1.5rem;
}

/* File Info Box */
.file-info-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #e5e7eb;
    border-radius: 8px;
    flex-shrink: 0;
}

.file-icon i {
    font-size: 1.5rem;
    color: #6b7280;
}

.file-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #111827;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.btn-copy-link,
.btn-download {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.btn-copy-link {
    background: white;
    color: #2563eb;
    border: 1px solid #2563eb;
}

.btn-copy-link:hover {
    background: #eff6ff;
}

.btn-download {
    background: #2563eb;
    color: white;
}

.btn-download:hover {
    background: #1d4ed8;
}

/* Copy Success Toast */
.copy-success-toast {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1rem;
    background: #d1fae5;
    color: #065f46;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    animation: toastIn 0.2s ease-out;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Install Instructions */
.install-instructions {
    border-top: 1px solid #e5e7eb;
    padding-top: 1.25rem;
}

.instructions-header {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.command-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #1e293b;
    border-radius: 6px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
}

.command-box code {
    flex: 1;
    font-size: 0.8125rem;
    color: #e2e8f0;
    word-break: break-all;
}

.btn-copy-small {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid #475569;
    border-radius: 4px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.btn-copy-small:hover {
    background: #334155;
    border-color: #64748b;
    color: #e2e8f0;
}

/* Error Message */
.error-message {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 1rem;
}

@media (max-width: 480px) {
    .success-modal {
        width: 95%;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .command-box {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .btn-copy-small {
        width: 100%;
        height: auto;
        padding: 0.5rem;
    }
}
