/* Modal styles */
#virtualCacModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1001;
    justify-content: center;
    align-items: center;
}

#virtualCacModal .modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 550px;
    position: relative;
}

#virtualCacModal .status-pill {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

#virtualCacModal .status-pill.connected {
    background: #4CAF50;
    color: white;
}

#virtualCacModal .status-pill.disconnected {
    background: #f44336;
    color: white;
}

/* Endpoints Section */
.endpoints-section {
    margin: 15px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.endpoints-section h3 {
    font-size: 14px;
    margin: 0 0 10px 0;
    color: #495057;
}

.endpoint-item {
    margin-bottom: 10px;
}

.endpoint-item label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 4px;
    color: #6c757d;
}

.endpoint-value {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #ced4da;
}

.endpoint-value code {
    flex: 1;
    font-size: 11px;
    word-break: break-all;
    color: #212529;
}

.copy-endpoint-btn {
    padding: 2px 8px;
    font-size: 11px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.copy-endpoint-btn:hover {
    background: #5a6268;
}

/* Browser ID Section */
.browser-id-container {
    margin: 20px 0;
}

.browser-id-container label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #495057;
}

.browser-id-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.browser-id-input {
    font-family: monospace;
    font-size: 18px;
    text-align: center;
    padding: 10px;
    flex: 1;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0;
    box-shadow: none;
}

.browser-id-input:focus {
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 1px #2196F3;
}

.help-text {
    font-size: 11px;
    color: #6c757d;
    margin-top: 5px;
    margin-bottom: 0;
}

/* Edit button styling */
#virtualCacModal .btn-edit {
    background: none;
    border: none;
    color: #2196F3;
    cursor: pointer;
    font-size: 14px;
    padding: 5px 10px;
    white-space: nowrap;
}

#virtualCacModal .btn-edit:hover {
    text-decoration: underline;
}

/* Download Section */
.download-section {
    margin: 15px 0;
    padding: 12px;
    background: #e3f2fd;
    border-radius: 6px;
    border: 1px solid #b8daff;
}

.download-section h3 {
    font-size: 14px;
    margin: 0 0 10px 0;
    color: #004085;
}

.download-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 6px 10px;
    margin: 8px 0;
    border-radius: 4px;
    font-size: 12px;
    color: #856404;
}

.download-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.btn-download, .btn-instructions {
    display: inline-block;
    padding: 8px 12px;
    font-size: 13px;
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-download {
    background: #28a745;
    color: white;
    border: none;
}

.btn-download:hover {
    background: #218838;
    transform: translateY(-1px);
}

.btn-instructions {
    background: #17a2b8;
    color: white;
    border: none;
}

.btn-instructions:hover {
    background: #138496;
    transform: translateY(-1px);
}

/* Modal Footer */
#virtualCacModal .modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

#virtualCacModal .modal-footer button {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 0;
    color: white;
    opacity: 1;
    transition: all 0.2s ease;
}

#virtualCacModal .btn-copy {
    background: #2196F3;
    flex: 1;
}

#virtualCacModal .btn-close {
    background: #f44336;
    flex: 1;
    min-width: fit-content;
    padding: 8px 15px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: auto !important;
}

#virtualCacModal .btn-copy:hover, 
#virtualCacModal .btn-close:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    #virtualCacModal .modal-content {
        padding: 15px;
        max-width: 95%;
    }
    
    .endpoint-value {
        flex-direction: column;
        align-items: stretch;
    }
    
    .endpoint-value code {
        word-break: break-all;
        font-size: 10px;
    }
    
    .copy-endpoint-btn {
        align-self: flex-end;
    }
    
    .download-buttons {
        flex-direction: column;
    }
    
    .browser-id-input-group {
        flex-wrap: wrap;
    }
    
    #virtualCacModal .modal-footer {
        flex-direction: column;
    }
}