/* Fork & Genealogy Styles */

/* Fork Modal */
.fork-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.fork-modal-content {
    background: #1e293b;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 30px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fork-modal-header {
    margin-bottom: 20px;
}

.fork-modal-header h2 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
}

.fork-original-title {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.fork-form-group {
    margin-bottom: 20px;
}

.fork-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.fork-form-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.fork-form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--success);
}

.fork-checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.fork-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.fork-checkbox-group label {
    margin: 0;
    cursor: pointer;
    color: var(--text-secondary);
}

/* Action Buttons Container */
.fork-modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Base Button Style */
.fork-btn {
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
}

/* Primary "Copy" Button */
.fork-btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    min-width: 180px;
}

.fork-btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.fork-btn-primary:active {
    transform: translateY(0);
}

.fork-btn-primary:disabled {
    background: #475569;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Secondary "Cancel" Button */
.fork-btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.fork-btn-secondary:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Genealogy Tree */
.genealogy-tree {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.05), rgba(33, 150, 243, 0.05));
    border-radius: 8px;
    border-left: 4px solid var(--success);
}

.genealogy-chain h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
}

.ancestor-chain {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.ancestor-item {
    display: flex;
    flex-direction: column;
    padding: 10px 15px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.ancestor-item a {
    color: var(--success);
    text-decoration: none;
    font-weight: 500;
}

.ancestor-item a:hover {
    text-decoration: underline;
}

.ancestor-item .author {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 4px;
}

.arrow {
    font-size: 1.5em;
    color: var(--text-secondary);
}

.current-trip {
    padding: 10px 15px;
    background: rgba(76, 175, 80, 0.2);
    border-radius: 6px;
    border: 2px solid var(--success);
}

.descendants-section {
    margin-top: 20px;
}

.descendants-section h4 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
}

.descendants-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.descendants-list li {
    padding: 10px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border-left: 3px solid var(--success);
    display: flex;
    align-items: center;
    gap: 10px;
}

.descendants-list li a {
    color: var(--success);
    text-decoration: none;
    font-weight: 500;
}

.descendants-list li a:hover {
    text-decoration: underline;
}

.badge-public {
    background: var(--success);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
}

.fork-author {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.fork-count {
    color: var(--warning);
    font-size: 0.85em;
    font-weight: 500;
}

/* Success Toast */
.success-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    animation: slideIn 0.3s ease-out;
}

.success-toast.fade-out {
    animation: fadeOut 0.3s ease-out;
}

.success-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.success-icon {
    font-size: 1.5em;
}

.success-text {
    font-weight: 500;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Fork Button */
.btn-fork {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-fork:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-fork:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .fork-modal-content {
        width: 95%;
        padding: 20px;
    }

    .ancestor-chain {
        flex-direction: column;
        align-items: flex-start;
    }

    .arrow {
        transform: rotate(90deg);
    }
}