/* Tab Drag and Drop Styles */

/* Dragging states */
.tab-dragging {
    opacity: 0.5;
    cursor: grabbing !important;
}

.tab-drag-over {
    background-color: rgba(66, 153, 225, 0.1);
    border: 2px dashed rgba(66, 153, 225, 0.5);
    border-radius: 4px;
}

.tab-drop-indicator {
    display: inline-block;
    width: 3px;
    height: 100%;
    background-color: #4299e1;
    vertical-align: top;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.tab-ghost {
    transform: rotate(2deg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Tab buttons enhancement */
.main-tab-button, .postcall-tab-button {
    cursor: grab;
    position: relative;
    transition: all 0.2s ease;
}

.main-tab-button:active, .postcall-tab-button:active {
    cursor: grabbing;
}

/* Add/Remove functionality */
.tab-add-button {
    padding: 0.5rem 0.75rem;
    background-color: transparent;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.6);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
}

.tab-add-button:hover {
    border-color: rgba(66, 153, 225, 0.6);
    color: #4299e1;
    background-color: rgba(66, 153, 225, 0.1);
}

.tab-close-button {
    display: none;
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: rgba(220, 38, 38, 0.2);
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    line-height: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.main-tab-button:hover .tab-close-button,
.postcall-tab-button:hover .tab-close-button {
    display: block;
}

.tab-close-button:hover {
    background-color: rgba(220, 38, 38, 0.9);
    color: white;
    border-color: #dc2626;
    transform: translateY(-50%) scale(1.1);
}

/* Tab picker modal */
.tab-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tab-picker-content {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    position: relative;
}

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

.tab-picker-content h3 {
    margin: 0 0 1.5rem 0;
    color: #fff;
    font-size: 1.5rem;
}

.tab-picker-content h4 {
    margin: 1rem 0 0.5rem 0;
    color: #999;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tab-picker-search {
    margin-bottom: 1.5rem;
}

.tab-search-input {
    width: 100%;
    padding: 0.75rem;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    color: white;
    font-size: 1rem;
}

.tab-search-input:focus {
    outline: none;
    border-color: #4299e1;
}

.tab-picker-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab-picker-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-picker-item:hover {
    background-color: #333;
    border-color: #4299e1;
    transform: translateY(-2px);
}

.tab-picker-item i {
    color: #4299e1;
}

/* Custom site form */
.custom-site-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background-color: #2a2a2a;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #444;
}

.custom-site-input {
    padding: 0.5rem;
    background-color: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    color: white;
}

.custom-site-input:focus {
    outline: none;
    border-color: #4299e1;
}

.proxy-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ccc;
    font-size: 0.875rem;
}

.proxy-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.add-custom-site-btn {
    padding: 0.75rem;
    background-color: #4299e1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.add-custom-site-btn:hover {
    background-color: #3182ce;
}

.tab-picker-close {
    margin-top: 1.5rem;
    padding: 0.5rem 1.5rem;
    background-color: #444;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    width: 100%;
}

.tab-picker-close:hover {
    background-color: #555;
}

.tab-picker-close-x {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    background-color: transparent;
    color: #999;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.tab-picker-close-x:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: #444;
}

/* Iframe tab content */
.iframe-tab-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.iframe-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #1a1a1a;
}

.iframe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background-color: #2a2a2a;
    border-bottom: 1px solid #444;
}

.iframe-url {
    color: #999;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.iframe-refresh {
    padding: 0.25rem 0.5rem;
    background-color: transparent;
    border: 1px solid #444;
    color: #999;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.iframe-refresh:hover {
    border-color: #4299e1;
    color: #4299e1;
}

.tab-iframe {
    flex: 1;
    width: 100%;
    border: none;
    background-color: white;
}

/* Toast notifications */
.tab-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background-color: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    color: white;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 10001;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.tab-toast.show {
    opacity: 1;
    transform: translateY(0);
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .tab-picker-list {
        grid-template-columns: 1fr;
    }
    
    .tab-add-button {
        padding: 0.5rem;
    }
    
    .tab-add-button span {
        display: none;
    }
}